home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / tool chest / macapp / ad lib 3.0.1 / install ad lib 3.0.1 / Ad Lib 3.0.1 / MacApp Extensions / UAdLibLink.cpp < prev    next >
MacBinary  |  1999-07-24  |  15.3 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jul 24 16:01:34 1999, modified Sat Jul 24 16:01:34 1999, creator 'CWIE', type ASCII, 14963 bytes "UAdLibLink.cpp" , at 0x3af3 474 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 55 41 64 4c 69 62 | 4c 69 6e 6b 2e 63 70 70 |..UAdLib|Link.cpp|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 3a 73 00 | 00 01 da b3 bf cc 1e b3 |.....:s.|........|
|00000060| bf cc 1e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 d0 b8 00 00 |........|........|
|00000080| 2f 2f 09 55 41 64 4c 69 | 62 4c 69 6e 6b 2e 63 70 |//.UAdLi|bLink.cp|
|00000090| 0d 2f 2f 09 43 6f 70 79 | 72 69 67 68 74 20 a9 20 |.//.Copy|right . |
|000000a0| 31 39 39 33 2d 31 39 39 | 35 20 4e 69 63 6b 20 4e |1993-199|5 Nick N|
|000000b0| 61 6c 6c 69 63 6b 2e 20 | 20 41 6c 6c 20 72 69 67 |allick. | All rig|
|000000c0| 68 74 73 20 72 65 73 65 | 72 76 65 64 2e 0d 2f 2f |hts rese|rved..//|
|000000d0| 0d 2f 2f 0d 2f 2f 09 43 | 68 61 6e 67 65 73 3a 0d |.//.//.C|hanges:.|
|000000e0| 2f 2f 0d 2f 2f 09 09 a5 | 09 41 64 64 20 4d 61 63 |//.//...|.Add Mac|
|000000f0| 41 70 70 20 33 2e 33 20 | 63 6f 6d 70 61 74 69 62 |App 3.3 |compatib|
|00000100| 69 6c 69 74 79 2e 0d 2f | 2f 09 09 a5 09 41 64 64 |ility../|/....Add|
|00000110| 20 4d 61 63 41 70 70 20 | 33 2e 31 20 63 6f 6d 70 | MacApp |3.1 comp|
|00000120| 61 74 69 62 69 6c 69 74 | 79 2e 0d 2f 2f 0d 0d 23 |atibilit|y..//..#|
|00000130| 69 66 6e 64 65 66 20 5f | 5f 52 45 53 4f 55 52 43 |ifndef _|_RESOURC|
|00000140| 45 53 5f 5f 0d 23 69 6e | 63 6c 75 64 65 20 3c 52 |ES__.#in|clude <R|
|00000150| 65 73 6f 75 72 63 65 73 | 2e 68 3e 0d 23 65 6e 64 |esources|.h>.#end|
|00000160| 69 66 0d 0d 23 69 66 6e | 64 65 66 20 5f 5f 4d 61 |if..#ifn|def __Ma|
|00000170| 63 41 70 70 43 6f 6d 70 | 61 74 69 62 69 6c 69 74 |cAppComp|atibilit|
|00000180| 79 5f 5f 0d 23 69 6e 63 | 6c 75 64 65 20 22 4d 61 |y__.#inc|lude "Ma|
|00000190| 63 41 70 70 43 6f 6d 70 | 61 74 69 62 69 6c 69 74 |cAppComp|atibilit|
|000001a0| 79 2e 68 22 0d 23 65 6e | 64 69 66 0d 0d 23 69 66 |y.h".#en|dif..#if|
|000001b0| 20 71 4d 61 63 41 70 70 | 56 65 72 73 69 6f 6e 20 | qMacApp|Version |
|000001c0| 21 3d 20 33 30 20 26 26 | 20 21 64 65 66 69 6e 65 |!= 30 &&| !define|
|000001d0| 64 28 5f 5f 4c 4f 57 4d | 45 4d 5f 5f 29 0d 23 69 |d(__LOWM|EM__).#i|
|000001e0| 6e 63 6c 75 64 65 20 22 | 4c 6f 77 4d 65 6d 2e 68 |nclude "|LowMem.h|
|000001f0| 22 0d 23 65 6e 64 69 66 | 0d 0d 23 70 72 61 67 6d |".#endif|..#pragm|
|00000200| 61 20 73 65 67 6d 65 6e | 74 20 41 64 4c 69 62 4c |a segmen|t AdLibL|
|00000210| 69 6e 6b 0d 0d 0d 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |ink...//|////////|
|00000220| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000230| 2f 2f 2f 2f 2f 2f 2f 20 | 54 41 64 4c 69 62 4c 69 |/////// |TAdLibLi|
|00000240| 6e 6b 20 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |nk /////|////////|
|00000250| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000260| 2f 2f 2f 2f 0d 2f 2f 0d | 2f 2f 09 41 20 62 65 68 |////.//.|//.A beh|
|00000270| 61 76 69 6f 72 20 74 6f | 20 72 65 63 65 69 76 65 |avior to| receive|
|00000280| 20 41 70 70 6c 65 45 76 | 65 6e 74 73 20 66 72 6f | AppleEv|ents fro|
|00000290| 6d 20 41 64 20 4c 69 62 | 20 74 6f 20 75 70 64 61 |m Ad Lib| to upda|
|000002a0| 74 65 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |te the a|pplicati|
|000002b0| 6f 6e 27 73 0d 2f 2f 09 | 27 56 69 65 77 27 20 72 |on's.//.|'View' r|
|000002c0| 65 73 6f 75 72 63 65 73 | 2e 20 20 41 64 64 20 74 |esources|. Add t|
|000002d0| 68 69 73 20 6f 62 6a 65 | 63 74 20 74 6f 20 79 6f |his obje|ct to yo|
|000002e0| 75 72 20 62 75 69 6c 64 | 20 61 6e 64 20 64 65 72 |ur build| and der|
|000002f0| 69 76 65 20 79 6f 75 72 | 20 61 70 70 6c 69 63 61 |ive your| applica|
|00000300| 74 69 6f 6e 0d 2f 2f 09 | 6f 62 6a 65 63 74 20 66 |tion.//.|object f|
|00000310| 72 6f 6d 20 54 42 65 68 | 61 76 69 6f 72 41 70 70 |rom TBeh|aviorApp|
|00000320| 2e 20 20 46 69 6e 61 6c | 6c 79 2c 20 69 6e 63 6c |. Final|ly, incl|
|00000330| 75 64 65 20 74 68 65 20 | 41 64 4c 69 62 4c 69 6e |ude the |AdLibLin|
|00000340| 6b 2e 72 20 66 69 6c 65 | 20 69 6e 20 79 6f 75 72 |k.r file| in your|
|00000350| 20 62 75 69 6c 64 2e 0d | 2f 2f 09 54 68 69 73 20 | build..|//.This |
|00000360| 77 69 6c 6c 20 70 65 72 | 6d 69 74 20 79 6f 75 72 |will per|mit your|
|00000370| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 74 6f 20 | applica|tion to |
|00000380| 62 65 20 75 73 65 64 20 | 77 69 74 68 20 74 68 65 |be used |with the|
|00000390| 20 27 4c 69 6e 6b 20 41 | 70 70 6c 69 63 61 74 69 | 'Link A|pplicati|
|000003a0| 6f 6e 27 0d 2f 2f 09 66 | 75 6e 63 74 69 6f 6e 20 |on'.//.f|unction |
|000003b0| 69 6e 20 41 64 20 4c 69 | 62 2e 0d 2f 2f 0d 0d 63 |in Ad Li|b..//..c|
|000003c0| 6c 61 73 73 20 54 41 64 | 4c 69 62 4c 69 6e 6b 20 |lass TAd|LibLink |
|000003d0| 3a 20 70 75 62 6c 69 63 | 20 54 42 65 68 61 76 69 |: public| TBehavi|
|000003e0| 6f 72 0d 7b 0d 23 69 66 | 20 71 4d 61 63 41 70 70 |or.{.#if| qMacApp|
|000003f0| 56 65 72 73 69 6f 6e 20 | 3e 20 33 30 0d 09 4d 41 |Version |> 30..MA|
|00000400| 5f 44 45 43 4c 41 52 45 | 5f 43 4c 41 53 53 3b 0d |_DECLARE|_CLASS;.|
|00000410| 23 65 6e 64 69 66 0d 0d | 09 70 75 62 6c 69 63 3a |#endif..|.public:|
|00000420| 0d 23 69 66 20 71 4d 61 | 63 41 70 70 56 65 72 73 |.#if qMa|cAppVers|
|00000430| 69 6f 6e 20 3e 20 33 33 | 0d 09 09 54 41 64 4c 69 |ion > 33|...TAdLi|
|00000440| 62 4c 69 6e 6b 28 49 44 | 54 79 70 65 20 69 74 73 |bLink(ID|Type its|
|00000450| 49 64 65 6e 74 69 66 69 | 65 72 20 3d 20 6b 4e 6f |Identifi|er = kNo|
|00000460| 49 64 65 6e 74 69 66 69 | 65 72 5f 41 43 29 3b 0d |Identifi|er_AC);.|
|00000470| 09 09 76 69 72 74 75 61 | 6c 20 7e 54 41 64 4c 69 |..virtua|l ~TAdLi|
|00000480| 62 4c 69 6e 6b 28 29 3b | 0d 23 65 6c 73 65 0d 09 |bLink();|.#else..|
|00000490| 09 56 49 52 54 55 41 4c | 09 76 6f 69 64 09 09 09 |.VIRTUAL|.void...|
|000004a0| 49 41 64 4c 69 62 4c 69 | 6e 6b 28 49 44 54 79 70 |IAdLibLi|nk(IDTyp|
|000004b0| 65 20 69 74 73 49 64 65 | 6e 74 69 66 69 65 72 29 |e itsIde|ntifier)|
|000004c0| 3b 0d 23 65 6e 64 69 66 | 0d 0d 23 69 66 20 71 4d |;.#endif|..#if qM|
|000004d0| 61 63 41 70 70 56 65 72 | 73 69 6f 6e 20 3d 3d 20 |acAppVer|sion == |
|000004e0| 33 30 20 7c 7c 20 71 4d | 61 63 41 70 70 56 65 72 |30 || qM|acAppVer|
|000004f0| 73 69 6f 6e 20 3d 3d 20 | 33 31 0d 09 09 56 49 52 |sion == |31...VIR|
|00000500| 54 55 41 4c 20 76 6f 69 | 64 09 09 09 44 6f 41 70 |TUAL voi|d...DoAp|
|00000510| 70 6c 65 43 6f 6d 6d 61 | 6e 64 28 43 6f 6d 6d 61 |pleComma|nd(Comma|
|00000520| 6e 64 4e 75 6d 62 65 72 | 20 63 6d 64 2c 20 63 6f |ndNumber| cmd, co|
|00000530| 6e 73 74 20 41 70 70 6c | 65 45 76 65 6e 74 26 20 |nst Appl|eEvent& |
|00000540| 6d 65 73 73 61 67 65 2c | 20 63 6f 6e 73 74 20 41 |message,| const A|
|00000550| 70 70 6c 65 45 76 65 6e | 74 26 20 72 65 70 6c 79 |ppleEven|t& reply|
|00000560| 29 3b 0d 23 65 6c 73 65 | 0d 09 09 56 49 52 54 55 |);.#else|...VIRTU|
|00000570| 41 4c 20 42 4f 4f 4c 45 | 41 4e 09 09 44 6f 53 63 |AL BOOLE|AN..DoSc|
|00000580| 72 69 70 74 43 6f 6d 6d | 61 6e 64 28 43 6f 6d 6d |riptComm|and(Comm|
|00000590| 61 6e 64 4e 75 6d 62 65 | 72 20 63 6d 64 2c 20 54 |andNumbe|r cmd, T|
|000005a0| 41 70 70 6c 65 45 76 65 | 6e 74 2a 20 6d 65 73 73 |AppleEve|nt* mess|
|000005b0| 61 67 65 2c 20 54 41 70 | 70 6c 65 45 76 65 6e 74 |age, TAp|pleEvent|
|000005c0| 2a 20 72 65 70 6c 79 29 | 3b 0d 23 65 6e 64 69 66 |* reply)|;.#endif|
|000005d0| 0d 0d 09 70 72 69 76 61 | 74 65 3a 0d 09 09 09 09 |...priva|te:.....|
|000005e0| 09 09 76 6f 69 64 09 09 | 09 41 64 64 28 63 6f 6e |..void..|.Add(con|
|000005f0| 73 74 20 41 70 70 6c 65 | 45 76 65 6e 74 26 20 6d |st Apple|Event& m|
|00000600| 65 73 73 61 67 65 2c 20 | 41 70 70 6c 65 45 76 65 |essage, |AppleEve|
|00000610| 6e 74 26 20 72 65 70 6c | 79 29 3b 0d 09 09 09 09 |nt& repl|y);.....|
|00000620| 09 09 76 6f 69 64 09 09 | 09 43 68 61 6e 67 65 28 |..void..|.Change(|
|00000630| 63 6f 6e 73 74 20 41 70 | 70 6c 65 45 76 65 6e 74 |const Ap|pleEvent|
|00000640| 26 20 6d 65 73 73 61 67 | 65 2c 20 41 70 70 6c 65 |& messag|e, Apple|
|00000650| 45 76 65 6e 74 26 20 72 | 65 70 6c 79 29 3b 0d 09 |Event& r|eply);..|
|00000660| 09 09 09 09 09 76 6f 69 | 64 09 09 09 52 65 6d 6f |.....voi|d...Remo|
|00000670| 76 65 28 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |ve(const| AppleEv|
|00000680| 65 6e 74 26 20 6d 65 73 | 73 61 67 65 2c 20 41 70 |ent& mes|sage, Ap|
|00000690| 70 6c 65 45 76 65 6e 74 | 26 20 72 65 70 6c 79 29 |pleEvent|& reply)|
|000006a0| 3b 0d 09 09 09 09 09 09 | 76 6f 69 64 09 09 09 53 |;.......|void...S|
|000006b0| 65 74 28 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |et(const| AppleEv|
|000006c0| 65 6e 74 26 20 6d 65 73 | 73 61 67 65 2c 20 41 70 |ent& mes|sage, Ap|
|000006d0| 70 6c 65 45 76 65 6e 74 | 26 20 72 65 70 6c 79 29 |pleEvent|& reply)|
|000006e0| 3b 0d 7d 3b 0d 0d 23 69 | 66 20 71 4d 61 63 41 70 |;.};..#i|f qMacAp|
|000006f0| 70 56 65 72 73 69 6f 6e | 20 3e 20 33 30 0d 4d 41 |pVersion| > 30.MA|
|00000700| 5f 44 45 46 49 4e 45 5f | 43 4c 41 53 53 5f 4d 31 |_DEFINE_|CLASS_M1|
|00000710| 28 54 41 64 4c 69 62 4c | 69 6e 6b 2c 20 54 42 65 |(TAdLibL|ink, TBe|
|00000720| 68 61 76 69 6f 72 29 3b | 0d 23 65 6e 64 69 66 0d |havior);|.#endif.|
|00000730| 0d 0d 23 70 72 61 67 6d | 61 20 73 65 67 6d 65 6e |..#pragm|a segmen|
|00000740| 74 20 4d 41 42 65 68 61 | 76 69 6f 72 52 65 73 0d |t MABeha|viorRes.|
|00000750| 0d 63 6f 6e 73 74 20 73 | 68 6f 72 74 20 6d 50 69 |.const s|hort mPi|
|00000760| 6e 67 4d 73 67 09 09 3d | 20 39 39 30 3b 0d 63 6f |ngMsg..=| 990;.co|
|00000770| 6e 73 74 20 73 68 6f 72 | 74 20 6d 41 64 64 4d 73 |nst shor|t mAddMs|
|00000780| 67 09 09 09 3d 20 39 39 | 31 3b 0d 63 6f 6e 73 74 |g...= 99|1;.const|
|00000790| 20 73 68 6f 72 74 20 6d | 43 68 61 6e 67 65 4d 73 | short m|ChangeMs|
|000007a0| 67 09 3d 20 39 39 32 3b | 0d 63 6f 6e 73 74 20 73 |g.= 992;|.const s|
|000007b0| 68 6f 72 74 20 6d 52 65 | 6d 6f 76 65 4d 73 67 09 |hort mRe|moveMsg.|
|000007c0| 3d 20 39 39 33 3b 0d 63 | 6f 6e 73 74 20 73 68 6f |= 993;.c|onst sho|
|000007d0| 72 74 20 6d 53 65 74 4d | 73 67 09 09 09 3d 20 39 |rt mSetM|sg...= 9|
|000007e0| 39 34 3b 0d 63 6f 6e 73 | 74 20 73 68 6f 72 74 20 |94;.cons|t short |
|000007f0| 6d 55 70 64 61 74 65 4d | 73 67 09 3d 20 39 39 35 |mUpdateM|sg.= 995|
|00000800| 3b 0d 0d 23 69 66 20 71 | 4d 61 63 41 70 70 56 65 |;..#if q|MacAppVe|
|00000810| 72 73 69 6f 6e 20 3e 20 | 33 33 0d 0d 2f 2f 09 43 |rsion > |33..//.C|
|00000820| 6f 6e 73 74 72 75 63 74 | 6f 72 0d 2f 2f 09 69 74 |onstruct|or.//.it|
|00000830| 73 49 64 65 6e 74 69 66 | 69 65 72 3a 09 74 68 65 |sIdentif|ier:.the|
|00000840| 20 62 65 68 61 76 69 6f | 72 27 73 20 69 64 65 6e | behavio|r's iden|
|00000850| 74 69 66 69 65 72 0d 2f | 2f 0d 54 41 64 4c 69 62 |tifier./|/.TAdLib|
|00000860| 4c 69 6e 6b 3a 3a 54 41 | 64 4c 69 62 4c 69 6e 6b |Link::TA|dLibLink|
|00000870| 28 49 44 54 79 70 65 20 | 69 74 73 49 64 65 6e 74 |(IDType |itsIdent|
|00000880| 69 66 69 65 72 29 20 3a | 0d 09 54 42 65 68 61 76 |ifier) :|..TBehav|
|00000890| 69 6f 72 28 69 74 73 49 | 64 65 6e 74 69 66 69 65 |ior(itsI|dentifie|
|000008a0| 72 29 0d 7b 0d 7d 0d 0d | 2f 2f 20 41 64 64 65 64 |r).{.}..|// Added|
|000008b0| 20 64 65 73 74 72 75 63 | 74 6f 72 09 2d 2d 09 4d | destruc|tor.--.M|
|000008c0| 42 2d 39 38 30 35 2d 32 | 39 2d 31 39 34 31 0d 54 |B-9805-2|9-1941.T|
|000008d0| 41 64 4c 69 62 4c 69 6e | 6b 3a 3a 7e 54 41 64 4c |AdLibLin|k::~TAdL|
|000008e0| 69 62 4c 69 6e 6b 28 29 | 0d 7b 0d 7d 0d 0d 23 65 |ibLink()|.{.}..#e|
|000008f0| 6e 64 69 66 0d 0d 23 69 | 66 20 71 4d 61 63 41 70 |ndif..#i|f qMacAp|
|00000900| 70 56 65 72 73 69 6f 6e | 20 3d 3d 20 33 30 20 7c |pVersion| == 30 ||
|00000910| 7c 20 71 4d 61 63 41 70 | 70 56 65 72 73 69 6f 6e || qMacAp|pVersion|
|00000920| 20 3d 3d 20 33 31 0d 0d | 2f 2f 09 4f 76 65 72 72 | == 31..|//.Overr|
|00000930| 69 64 65 73 20 54 42 65 | 68 61 76 69 6f 72 0d 2f |ides TBe|havior./|
|00000940| 2f 09 48 61 6e 64 6c 65 | 20 41 64 20 4c 69 62 27 |/.Handle| Ad Lib'|
|00000950| 73 20 72 65 73 6f 75 72 | 63 65 20 73 61 76 69 6e |s resour|ce savin|
|00000960| 67 20 41 70 70 6c 65 45 | 76 65 6e 74 73 2e 0d 2f |g AppleE|vents../|
|00000970| 2f 0d 4d 41 43 41 50 50 | 5f 4d 45 54 48 4f 44 0d |/.MACAPP|_METHOD.|
|00000980| 76 6f 69 64 20 54 41 64 | 4c 69 62 4c 69 6e 6b 3a |void TAd|LibLink:|
|00000990| 3a 44 6f 41 70 70 6c 65 | 43 6f 6d 6d 61 6e 64 28 |:DoApple|Command(|
|000009a0| 43 6f 6d 6d 61 6e 64 4e | 75 6d 62 65 72 20 63 6d |CommandN|umber cm|
|000009b0| 64 2c 20 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |d, const| AppleEv|
|000009c0| 65 6e 74 26 20 6d 65 73 | 73 61 67 65 2c 20 63 6f |ent& mes|sage, co|
|000009d0| 6e 73 74 20 41 70 70 6c | 65 45 76 65 6e 74 26 20 |nst Appl|eEvent& |
|000009e0| 72 65 70 6c 79 29 0d 7b | 0d 09 73 77 69 74 63 68 |reply).{|..switch|
|000009f0| 20 28 63 6d 64 29 0d 09 | 7b 0d 09 09 63 61 73 65 | (cmd)..|{...case|
|00000a00| 20 6d 50 69 6e 67 4d 73 | 67 3a 09 09 62 72 65 61 | mPingMs|g:..brea|
|00000a10| 6b 3b 0d 09 09 63 61 73 | 65 20 6d 41 64 64 4d 73 |k;...cas|e mAddMs|
|00000a20| 67 3a 09 09 09 41 64 64 | 28 6d 65 73 73 61 67 65 |g:...Add|(message|
|00000a30| 2c 20 72 65 70 6c 79 29 | 3b 0d 09 09 09 09 09 09 |, reply)|;.......|
|00000a40| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 63 61 |.....bre|ak;...ca|
|00000a50| 73 65 20 6d 43 68 61 6e | 67 65 4d 73 67 3a 09 43 |se mChan|geMsg:.C|
|00000a60| 68 61 6e 67 65 28 6d 65 | 73 73 61 67 65 2c 20 72 |hange(me|ssage, r|
|00000a70| 65 70 6c 79 29 3b 0d 09 | 09 09 09 09 09 09 09 09 |eply);..|........|
|00000a80| 09 09 62 72 65 61 6b 3b | 0d 09 09 63 61 73 65 20 |..break;|...case |
|00000a90| 6d 52 65 6d 6f 76 65 4d | 73 67 3a 09 52 65 6d 6f |mRemoveM|sg:.Remo|
|00000aa0| 76 65 28 6d 65 73 73 61 | 67 65 2c 20 72 65 70 6c |ve(messa|ge, repl|
|00000ab0| 79 29 3b 0d 09 09 09 09 | 09 09 09 09 09 09 09 62 |y);.....|.......b|
|00000ac0| 72 65 61 6b 3b 0d 09 09 | 63 61 73 65 20 6d 53 65 |reak;...|case mSe|
|00000ad0| 74 4d 73 67 3a 09 09 09 | 53 65 74 28 6d 65 73 73 |tMsg:...|Set(mess|
|00000ae0| 61 67 65 2c 20 72 65 70 | 6c 79 29 3b 0d 09 09 09 |age, rep|ly);....|
|00000af0| 09 09 09 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |........|break;..|
|00000b00| 09 63 61 73 65 20 6d 55 | 70 64 61 74 65 4d 73 67 |.case mU|pdateMsg|
|00000b10| 3a 09 55 70 64 61 74 65 | 52 65 73 46 69 6c 65 28 |:.Update|ResFile(|
|00000b20| 67 41 70 70 6c 69 63 61 | 74 69 6f 6e 52 65 66 4e |gApplica|tionRefN|
|00000b30| 75 6d 29 3b 0d 09 09 09 | 09 09 09 09 09 09 09 09 |um);....|........|
|00000b40| 54 48 52 4f 57 49 46 52 | 45 53 45 52 52 4f 52 28 |THROWIFR|ESERROR(|
|00000b50| 29 3b 0d 09 09 09 09 09 | 09 09 09 09 09 09 62 72 |);......|......br|
|00000b60| 65 61 6b 3b 0d 09 09 64 | 65 66 61 75 6c 74 3a 09 |eak;...d|efault:.|
|00000b70| 09 09 09 09 54 42 65 68 | 61 76 69 6f 72 3a 3a 44 |....TBeh|avior::D|
|00000b80| 6f 41 70 70 6c 65 43 6f | 6d 6d 61 6e 64 28 63 6d |oAppleCo|mmand(cm|
|00000b90| 64 2c 20 6d 65 73 73 61 | 67 65 2c 20 72 65 70 6c |d, messa|ge, repl|
|00000ba0| 79 29 3b 0d 09 09 09 09 | 09 09 09 09 09 09 09 62 |y);.....|.......b|
|00000bb0| 72 65 61 6b 3b 0d 09 7d | 0d 7d 0d 0d 23 65 6c 73 |reak;..}|.}..#els|
|00000bc0| 65 0d 0d 2f 2f 09 4f 76 | 65 72 72 69 64 65 73 20 |e..//.Ov|errides |
|00000bd0| 54 42 65 68 61 76 69 6f | 72 0d 2f 2f 09 48 61 6e |TBehavio|r.//.Han|
|00000be0| 64 6c 65 20 41 64 20 4c | 69 62 27 73 20 72 65 73 |dle Ad L|ib's res|
|00000bf0| 6f 75 72 63 65 20 73 61 | 76 69 6e 67 20 41 70 70 |ource sa|ving App|
|00000c00| 6c 65 45 76 65 6e 74 73 | 2e 0d 2f 2f 0d 2f 2f 20 |leEvents|..//.// |
|00000c10| 62 70 61 20 36 2f 32 30 | 2f 39 37 20 2d 20 63 68 |bpa 6/20|/97 - ch|
|00000c20| 61 6e 67 65 64 20 66 4d | 65 73 73 61 67 65 20 74 |anged fM|essage t|
|00000c30| 6f 20 47 65 74 41 45 44 | 65 73 63 0d 0d 69 6e 6c |o GetAED|esc..inl|
|00000c40| 69 6e 65 20 41 45 44 65 | 73 63 20 47 65 74 41 45 |ine AEDe|sc GetAE|
|00000c50| 44 65 73 63 28 54 41 70 | 70 6c 65 45 76 65 6e 74 |Desc(TAp|pleEvent|
|00000c60| 2a 20 65 76 65 6e 74 29 | 20 0d 23 69 66 20 71 4d |* event)| .#if qM|
|00000c70| 61 63 41 70 70 56 65 72 | 73 69 6f 6e 20 3e 20 33 |acAppVer|sion > 3|
|00000c80| 33 0d 7b 20 72 65 74 75 | 72 6e 20 2a 65 76 65 6e |3.{ retu|rn *even|
|00000c90| 74 3b 20 7d 0d 23 65 6c | 73 65 0d 7b 20 72 65 74 |t; }.#el|se.{ ret|
|00000ca0| 75 72 6e 20 65 76 65 6e | 74 2d 3e 66 4d 65 73 73 |urn even|t->fMess|
|00000cb0| 61 67 65 3b 20 7d 0d 23 | 65 6e 64 69 66 0d 0d 4d |age; }.#|endif..M|
|00000cc0| 41 43 41 50 50 5f 4d 45 | 54 48 4f 44 0d 42 4f 4f |ACAPP_ME|THOD.BOO|
|00000cd0| 4c 45 41 4e 20 54 41 64 | 4c 69 62 4c 69 6e 6b 3a |LEAN TAd|LibLink:|
|00000ce0| 3a 44 6f 53 63 72 69 70 | 74 43 6f 6d 6d 61 6e 64 |:DoScrip|tCommand|
|00000cf0| 28 43 6f 6d 6d 61 6e 64 | 4e 75 6d 62 65 72 20 63 |(Command|Number c|
|00000d00| 6d 64 2c 20 54 41 70 70 | 6c 65 45 76 65 6e 74 2a |md, TApp|leEvent*|
|00000d10| 20 6d 65 73 73 61 67 65 | 2c 20 54 41 70 70 6c 65 | message|, TApple|
|00000d20| 45 76 65 6e 74 2a 20 72 | 65 70 6c 79 29 0d 7b 0d |Event* r|eply).{.|
|00000d30| 09 73 77 69 74 63 68 20 | 28 63 6d 64 29 0d 09 7b |.switch |(cmd)..{|
|00000d40| 0d 09 09 63 61 73 65 20 | 6d 50 69 6e 67 4d 73 67 |...case |mPingMsg|
|00000d50| 3a 09 09 62 72 65 61 6b | 3b 0d 09 09 63 61 73 65 |:..break|;...case|
|00000d60| 20 6d 41 64 64 4d 73 67 | 3a 0d 09 09 7b 09 09 09 | mAddMsg|:...{...|
|00000d70| 09 09 09 09 09 09 2f 2f | 20 41 64 64 20 74 65 6d |......//| Add tem|
|00000d80| 70 20 76 61 72 69 61 62 | 6c 65 73 20 74 6f 20 67 |p variab|les to g|
|00000d90| 65 74 20 72 69 64 20 6f | 66 20 63 6f 6d 70 69 6c |et rid o|f compil|
|00000da0| 65 72 20 77 61 72 6e 69 | 6e 67 09 2d 2d 09 4d 42 |er warni|ng.--.MB|
|00000db0| 2d 39 39 30 37 2d 31 37 | 2d 31 30 31 30 0d 09 09 |-9907-17|-1010...|
|00000dc0| 09 09 09 09 09 09 09 09 | 09 41 45 44 65 73 63 20 |........|.AEDesc |
|00000dd0| 6d 73 67 44 65 73 63 20 | 3d 20 47 65 74 41 45 44 |msgDesc |= GetAED|
|00000de0| 65 73 63 28 6d 65 73 73 | 61 67 65 29 3b 0d 09 09 |esc(mess|age);...|
|00000df0| 09 09 09 09 09 09 09 09 | 09 41 45 44 65 73 63 20 |........|.AEDesc |
|00000e00| 72 65 70 6c 79 44 65 73 | 63 20 3d 20 47 65 74 41 |replyDes|c = GetA|
|00000e10| 45 44 65 73 63 28 72 65 | 70 6c 79 29 3b 0d 09 09 |EDesc(re|ply);...|
|00000e20| 09 09 09 09 09 09 09 09 | 09 41 64 64 28 6d 73 67 |........|.Add(msg|
|00000e30| 44 65 73 63 2c 20 72 65 | 70 6c 79 44 65 73 63 29 |Desc, re|plyDesc)|
|00000e40| 3b 0d 09 09 7d 0d 09 09 | 09 09 09 09 09 09 09 09 |;...}...|........|
|00000e50| 09 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 20 6d |.break;.|..case m|
|00000e60| 43 68 61 6e 67 65 4d 73 | 67 3a 0d 09 09 7b 09 09 |ChangeMs|g:...{..|
|00000e70| 09 09 09 09 09 09 09 2f | 2f 20 41 64 64 20 74 65 |......./|/ Add te|
|00000e80| 6d 70 20 76 61 72 69 61 | 62 6c 65 73 20 74 6f 20 |mp varia|bles to |
|00000e90| 67 65 74 20 72 69 64 20 | 6f 66 20 63 6f 6d 70 69 |get rid |of compi|
|00000ea0| 6c 65 72 20 77 61 72 6e | 69 6e 67 09 2d 2d 09 4d |ler warn|ing.--.M|
|00000eb0| 42 2d 39 39 30 37 2d 31 | 37 2d 31 30 31 30 0d 09 |B-9907-1|7-1010..|
|00000ec0| 09 09 09 09 09 09 09 09 | 09 09 41 45 44 65 73 63 |........|..AEDesc|
|00000ed0| 20 6d 73 67 44 65 73 63 | 20 3d 20 47 65 74 41 45 | msgDesc| = GetAE|
|00000ee0| 44 65 73 63 28 6d 65 73 | 73 61 67 65 29 3b 0d 09 |Desc(mes|sage);..|
|00000ef0| 09 09 09 09 09 09 09 09 | 09 09 41 45 44 65 73 63 |........|..AEDesc|
|00000f00| 20 72 65 70 6c 79 44 65 | 73 63 20 3d 20 47 65 74 | replyDe|sc = Get|
|00000f10| 41 45 44 65 73 63 28 72 | 65 70 6c 79 29 3b 0d 09 |AEDesc(r|eply);..|
|00000f20| 09 09 09 09 09 09 09 09 | 09 09 43 68 61 6e 67 65 |........|..Change|
|00000f30| 28 6d 73 67 44 65 73 63 | 2c 20 72 65 70 6c 79 44 |(msgDesc|, replyD|
|00000f40| 65 73 63 29 3b 0d 09 09 | 7d 0d 09 09 09 09 09 09 |esc);...|}.......|
|00000f50| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 63 61 |.....bre|ak;...ca|
|00000f60| 73 65 20 6d 52 65 6d 6f | 76 65 4d 73 67 3a 0d 09 |se mRemo|veMsg:..|
|00000f70| 09 7b 09 09 09 09 09 09 | 09 09 09 2f 2f 20 41 64 |.{......|...// Ad|
|00000f80| 64 20 74 65 6d 70 20 76 | 61 72 69 61 62 6c 65 73 |d temp v|ariables|
|00000f90| 20 74 6f 20 67 65 74 20 | 72 69 64 20 6f 66 20 63 | to get |rid of c|
|00000fa0| 6f 6d 70 69 6c 65 72 20 | 77 61 72 6e 69 6e 67 09 |ompiler |warning.|
|00000fb0| 2d 2d 09 4d 42 2d 39 39 | 30 37 2d 31 37 2d 31 30 |--.MB-99|07-17-10|
|00000fc0| 31 30 0d 09 09 09 09 09 | 09 09 09 09 09 09 41 45 |10......|......AE|
|00000fd0| 44 65 73 63 20 6d 73 67 | 44 65 73 63 20 3d 20 47 |Desc msg|Desc = G|
|00000fe0| 65 74 41 45 44 65 73 63 | 28 6d 65 73 73 61 67 65 |etAEDesc|(message|
|00000ff0| 29 3b 0d 09 09 09 09 09 | 09 09 09 09 09 09 41 45 |);......|......AE|
|00001000| 44 65 73 63 20 72 65 70 | 6c 79 44 65 73 63 20 3d |Desc rep|lyDesc =|
|00001010| 20 47 65 74 41 45 44 65 | 73 63 28 72 65 70 6c 79 | GetAEDe|sc(reply|
|00001020| 29 3b 0d 09 09 09 09 09 | 09 09 09 09 09 09 52 65 |);......|......Re|
|00001030| 6d 6f 76 65 28 6d 73 67 | 44 65 73 63 2c 20 72 65 |move(msg|Desc, re|
|00001040| 70 6c 79 44 65 73 63 29 | 3b 0d 09 09 7d 0d 09 09 |plyDesc)|;...}...|
|00001050| 09 09 09 09 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |........|.break;.|
|00001060| 09 09 63 61 73 65 20 6d | 53 65 74 4d 73 67 3a 0d |..case m|SetMsg:.|
|00001070| 09 09 7b 09 09 09 09 09 | 09 09 09 09 2f 2f 20 41 |..{.....|....// A|
|00001080| 64 64 20 74 65 6d 70 20 | 76 61 72 69 61 62 6c 65 |dd temp |variable|
|00001090| 73 20 74 6f 20 67 65 74 | 20 72 69 64 20 6f 66 20 |s to get| rid of |
|000010a0| 63 6f 6d 70 69 6c 65 72 | 20 77 61 72 6e 69 6e 67 |compiler| warning|
|000010b0| 09 2d 2d 09 4d 42 2d 39 | 39 30 37 2d 31 37 2d 31 |.--.MB-9|907-17-1|
|000010c0| 30 31 30 0d 09 09 09 09 | 09 09 09 09 09 09 09 41 |010.....|.......A|
|000010d0| 45 44 65 73 63 20 6d 73 | 67 44 65 73 63 20 3d 20 |EDesc ms|gDesc = |
|000010e0| 47 65 74 41 45 44 65 73 | 63 28 6d 65 73 73 61 67 |GetAEDes|c(messag|
|000010f0| 65 29 3b 0d 09 09 09 09 | 09 09 09 09 09 09 09 41 |e);.....|.......A|
|00001100| 45 44 65 73 63 20 72 65 | 70 6c 79 44 65 73 63 20 |EDesc re|plyDesc |
|00001110| 3d 20 47 65 74 41 45 44 | 65 73 63 28 72 65 70 6c |= GetAED|esc(repl|
|00001120| 79 29 3b 0d 09 09 09 09 | 09 09 09 09 09 09 09 53 |y);.....|.......S|
|00001130| 65 74 28 6d 73 67 44 65 | 73 63 2c 20 72 65 70 6c |et(msgDe|sc, repl|
|00001140| 79 44 65 73 63 29 3b 0d | 09 09 7d 0d 09 09 09 09 |yDesc);.|..}.....|
|00001150| 09 09 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |.......b|reak;...|
|00001160| 63 61 73 65 20 6d 55 70 | 64 61 74 65 4d 73 67 3a |case mUp|dateMsg:|
|00001170| 09 55 70 64 61 74 65 52 | 65 73 46 69 6c 65 28 67 |.UpdateR|esFile(g|
|00001180| 41 70 70 6c 69 63 61 74 | 69 6f 6e 52 65 66 4e 75 |Applicat|ionRefNu|
|00001190| 6d 29 3b 0d 09 09 09 09 | 09 09 09 09 09 09 09 54 |m);.....|.......T|
|000011a0| 48 52 4f 57 49 46 52 45 | 53 45 52 52 4f 52 28 29 |HROWIFRE|SERROR()|
|000011b0| 3b 0d 09 09 09 09 09 09 | 09 09 09 09 09 62 72 65 |;.......|.....bre|
|000011c0| 61 6b 3b 0d 09 09 64 65 | 66 61 75 6c 74 3a 09 09 |ak;...de|fault:..|
|000011d0| 09 09 09 72 65 74 75 72 | 6e 20 54 42 65 68 61 76 |...retur|n TBehav|
|000011e0| 69 6f 72 3a 3a 44 6f 53 | 63 72 69 70 74 43 6f 6d |ior::DoS|criptCom|
|000011f0| 6d 61 6e 64 28 63 6d 64 | 2c 20 6d 65 73 73 61 67 |mand(cmd|, messag|
|00001200| 65 2c 20 72 65 70 6c 79 | 29 3b 0d 09 7d 0d 0d 09 |e, reply|);..}...|
|00001210| 72 65 74 75 72 6e 20 54 | 52 55 45 3b 0d 7d 0d 0d |return T|RUE;.}..|
|00001220| 23 65 6e 64 69 66 0d 0d | 0d 23 70 72 61 67 6d 61 |#endif..|.#pragma|
|00001230| 20 73 65 67 6d 65 6e 74 | 20 4d 41 4f 70 65 6e 0d | segment| MAOpen.|
|00001240| 0d 2f 2f 09 49 6e 69 74 | 69 61 6c 69 7a 65 20 74 |.//.Init|ialize t|
|00001250| 68 65 20 62 65 68 61 76 | 69 6f 72 2e 0d 2f 2f 0d |he behav|ior..//.|
|00001260| 2f 2f 09 69 74 73 49 64 | 65 6e 74 69 66 69 65 72 |//.itsId|entifier|
|00001270| 3a 09 74 68 65 20 62 65 | 68 61 76 69 6f 72 27 73 |:.the be|havior's|
|00001280| 20 69 64 65 6e 74 69 66 | 69 65 72 0d 2f 2f 0d 23 | identif|ier.//.#|
|00001290| 69 66 20 71 4d 61 63 41 | 70 70 56 65 72 73 69 6f |if qMacA|ppVersio|
|000012a0| 6e 20 3c 3d 20 33 33 0d | 4d 41 43 41 50 50 5f 4d |n <= 33.|MACAPP_M|
|000012b0| 45 54 48 4f 44 0d 76 6f | 69 64 20 54 41 64 4c 69 |ETHOD.vo|id TAdLi|
|000012c0| 62 4c 69 6e 6b 3a 3a 49 | 41 64 4c 69 62 4c 69 6e |bLink::I|AdLibLin|
|000012d0| 6b 28 49 44 54 79 70 65 | 20 69 74 73 49 64 65 6e |k(IDType| itsIden|
|000012e0| 74 69 66 69 65 72 29 0d | 7b 0d 09 49 42 65 68 61 |tifier).|{..IBeha|
|000012f0| 76 69 6f 72 28 69 74 73 | 49 64 65 6e 74 69 66 69 |vior(its|Identifi|
|00001300| 65 72 29 3b 0d 7d 0d 23 | 65 6e 64 69 66 0d 0d 0d |er);.}.#|endif...|
|00001310| 23 70 72 61 67 6d 61 20 | 73 65 67 6d 65 6e 74 20 |#pragma |segment |
|00001320| 41 64 4c 69 62 4c 69 6e | 6b 0d 0d 23 69 66 20 71 |AdLibLin|k..#if q|
|00001330| 4d 61 63 41 70 70 56 65 | 72 73 69 6f 6e 20 3d 3d |MacAppVe|rsion ==|
|00001340| 20 33 30 0d 0d 2f 2f 09 | 48 61 6e 64 6c 65 20 74 | 30..//.|Handle t|
|00001350| 68 65 20 61 64 64 20 72 | 65 73 6f 75 72 63 65 20 |he add r|esource |
|00001360| 41 70 70 6c 65 45 76 65 | 6e 74 2e 0d 2f 2f 0d 2f |AppleEve|nt..//./|
|00001370| 2f 09 6d 65 73 73 61 67 | 65 3a 09 09 74 68 65 20 |/.messag|e:..the |
|00001380| 41 70 70 6c 65 45 76 65 | 6e 74 0d 2f 2f 09 72 65 |AppleEve|nt.//.re|
|00001390| 70 6c 79 3a 09 09 09 74 | 68 65 20 72 65 70 6c 79 |ply:...t|he reply|
|000013a0| 20 41 70 70 6c 65 45 76 | 65 6e 74 0d 2f 2f 0d 76 | AppleEv|ent.//.v|
|000013b0| 6f 69 64 20 54 41 64 4c | 69 62 4c 69 6e 6b 3a 3a |oid TAdL|ibLink::|
|000013c0| 41 64 64 28 63 6f 6e 73 | 74 20 41 70 70 6c 65 45 |Add(cons|t AppleE|
|000013d0| 76 65 6e 74 26 20 6d 65 | 73 73 61 67 65 2c 20 63 |vent& me|ssage, c|
|000013e0| 6f 6e 73 74 20 41 70 70 | 6c 65 45 76 65 6e 74 26 |onst App|leEvent&|
|000013f0| 20 72 65 70 6c 79 29 0d | 7b 0d 09 73 68 6f 72 74 | reply).|{..short|
|00001400| 20 69 64 2c 20 61 74 74 | 72 69 62 75 74 65 73 3b | id, att|ributes;|
|00001410| 0d 09 52 65 73 54 79 70 | 65 20 74 79 70 65 3b 0d |..ResTyp|e type;.|
|00001420| 09 44 65 73 63 54 79 70 | 65 20 61 63 74 75 61 6c |.DescTyp|e actual|
|00001430| 4d 73 67 54 79 70 65 3b | 0d 09 53 69 7a 65 20 73 |MsgType;|..Size s|
|00001440| 69 7a 65 3b 0d 0d 09 54 | 48 52 4f 57 49 46 4f 53 |ize;...T|HROWIFOS|
|00001450| 45 52 52 28 41 45 47 65 | 74 50 61 72 61 6d 50 74 |ERR(AEGe|tParamPt|
|00001460| 72 28 6d 65 73 73 61 67 | 65 2c 20 27 52 54 59 50 |r(messag|e, 'RTYP|
|00001470| 27 2c 20 27 52 53 52 43 | 27 2c 20 61 63 74 75 61 |', 'RSRC|', actua|
|00001480| 6c 4d 73 67 54 79 70 65 | 2c 20 28 50 74 72 29 20 |lMsgType|, (Ptr) |
|00001490| 26 74 79 70 65 2c 20 73 | 69 7a 65 6f 66 28 74 79 |&type, s|izeof(ty|
|000014a0| 70 65 29 2c 20 73 69 7a | 65 29 29 3b 0d 09 54 48 |pe), siz|e));..TH|
|000014b0| 52 4f 57 49 46 4f 53 45 | 52 52 28 41 45 47 65 74 |ROWIFOSE|RR(AEGet|
|000014c0| 50 61 72 61 6d 50 74 72 | 28 6d 65 73 73 61 67 65 |ParamPtr|(message|
|000014d0| 2c 20 27 52 49 44 20 27 | 2c 20 74 79 70 65 53 68 |, 'RID '|, typeSh|
|000014e0| 6f 72 74 49 6e 74 65 67 | 65 72 2c 20 61 63 74 75 |ortInteg|er, actu|
|000014f0| 61 6c 4d 73 67 54 79 70 | 65 2c 20 28 50 74 72 29 |alMsgTyp|e, (Ptr)|
|00001500| 20 26 69 64 2c 20 73 69 | 7a 65 6f 66 28 69 64 29 | &id, si|zeof(id)|
|00001510| 2c 20 73 69 7a 65 29 29 | 3b 0d 09 4f 53 45 72 72 |, size))|;..OSErr|
|00001520| 20 65 72 72 6f 72 20 3d | 20 41 45 47 65 74 50 61 | error =| AEGetPa|
|00001530| 72 61 6d 50 74 72 28 6d | 65 73 73 61 67 65 2c 20 |ramPtr(m|essage, |
|00001540| 27 41 54 54 52 27 2c 20 | 74 79 70 65 53 68 6f 72 |'ATTR', |typeShor|
|00001550| 74 49 6e 74 65 67 65 72 | 2c 20 61 63 74 75 61 6c |tInteger|, actual|
|00001560| 4d 73 67 54 79 70 65 2c | 20 28 50 74 72 29 20 26 |MsgType,| (Ptr) &|
|00001570| 61 74 74 72 69 62 75 74 | 65 73 2c 20 73 69 7a 65 |attribut|es, size|
|00001580| 6f 66 28 69 64 29 2c 20 | 73 69 7a 65 29 3b 0d 09 |of(id), |size);..|
|00001590| 42 6f 6f 6c 65 61 6e 20 | 73 65 74 41 74 74 72 69 |Boolean |setAttri|
|000015a0| 62 75 74 65 73 20 3d 20 | 28 65 72 72 6f 72 20 3d |butes = |(error =|
|000015b0| 3d 20 6e 6f 45 72 72 29 | 3b 0d 09 69 66 20 28 65 |= noErr)|;..if (e|
|000015c0| 72 72 6f 72 20 3d 3d 20 | 65 72 72 41 45 44 65 73 |rror == |errAEDes|
|000015d0| 63 4e 6f 74 46 6f 75 6e | 64 29 0d 09 09 65 72 72 |cNotFoun|d)...err|
|000015e0| 6f 72 20 3d 20 6e 6f 45 | 72 72 3b 0d 09 54 48 52 |or = noE|rr;..THR|
|000015f0| 4f 57 49 46 4f 53 45 52 | 52 28 65 72 72 6f 72 29 |OWIFOSER|R(error)|
|00001600| 3b 0d 09 54 48 52 4f 57 | 49 46 4f 53 45 52 52 28 |;..THROW|IFOSERR(|
|00001610| 41 45 53 69 7a 65 4f 66 | 50 61 72 61 6d 28 6d 65 |AESizeOf|Param(me|
|00001620| 73 73 61 67 65 2c 20 27 | 44 41 54 41 27 2c 20 61 |ssage, '|DATA', a|
|00001630| 63 74 75 61 6c 4d 73 67 | 54 79 70 65 2c 20 73 69 |ctualMsg|Type, si|
|00001640| 7a 65 29 29 3b 0d 0d 09 | 69 66 20 28 73 69 7a 65 |ze));...|if (size|
|00001650| 20 3e 20 30 29 0d 09 7b | 0d 09 09 4d 41 56 6f 6c | > 0)..{|...MAVol|
|00001660| 61 74 69 6c 65 49 6e 69 | 74 28 48 61 6e 64 6c 65 |atileIni|t(Handle|
|00001670| 2c 20 64 61 74 61 2c 20 | 4e 55 4c 4c 29 3b 0d 09 |, data, |NULL);..|
|00001680| 09 46 61 69 6c 49 6e 66 | 6f 20 66 69 3b 0d 09 09 |.FailInf|o fi;...|
|00001690| 54 52 59 28 66 69 29 0d | 09 09 7b 0d 09 09 09 64 |TRY(fi).|..{....d|
|000016a0| 61 74 61 20 3d 20 4e 65 | 77 50 65 72 6d 48 61 6e |ata = Ne|wPermHan|
|000016b0| 64 6c 65 28 73 69 7a 65 | 29 3b 0d 09 09 09 48 4c |dle(size|);....HL|
|000016c0| 6f 63 6b 28 64 61 74 61 | 29 3b 0d 09 09 09 54 48 |ock(data|);....TH|
|000016d0| 52 4f 57 49 46 4f 53 45 | 52 52 28 41 45 47 65 74 |ROWIFOSE|RR(AEGet|
|000016e0| 50 61 72 61 6d 50 74 72 | 28 6d 65 73 73 61 67 65 |ParamPtr|(message|
|000016f0| 2c 20 27 44 41 54 41 27 | 2c 20 27 64 61 74 61 27 |, 'DATA'|, 'data'|
|00001700| 2c 20 61 63 74 75 61 6c | 4d 73 67 54 79 70 65 2c |, actual|MsgType,|
|00001710| 20 2a 64 61 74 61 2c 20 | 73 69 7a 65 2c 20 73 69 | *data, |size, si|
|00001720| 7a 65 29 29 3b 0d 09 09 | 09 48 55 6e 6c 6f 63 6b |ze));...|.HUnlock|
|00001730| 28 64 61 74 61 29 3b 0d | 09 09 09 73 68 6f 72 74 |(data);.|...short|
|00001740| 20 63 75 72 52 73 72 63 | 46 69 6c 65 20 3d 20 55 | curRsrc|File = U|
|00001750| 53 45 52 45 53 46 49 4c | 45 28 67 41 70 70 6c 69 |SERESFIL|E(gAppli|
|00001760| 63 61 74 69 6f 6e 52 65 | 66 4e 75 6d 29 3b 0d 09 |cationRe|fNum);..|
|00001770| 09 09 41 64 64 52 65 73 | 6f 75 72 63 65 28 64 61 |..AddRes|ource(da|
|00001780| 74 61 2c 20 74 79 70 65 | 2c 20 69 64 2c 20 67 45 |ta, type|, id, gE|
|00001790| 6d 70 74 79 53 74 72 69 | 6e 67 29 3b 0d 09 09 09 |mptyStri|ng);....|
|000017a0| 65 72 72 6f 72 20 3d 20 | 52 65 73 45 72 72 6f 72 |error = |ResError|
|000017b0| 28 29 3b 0d 09 09 09 55 | 53 45 52 45 53 46 49 4c |();....U|SERESFIL|
|000017c0| 45 28 63 75 72 52 73 72 | 63 46 69 6c 65 29 3b 0d |E(curRsr|cFile);.|
|000017d0| 09 09 09 54 48 52 4f 57 | 49 46 4f 53 45 52 52 28 |...THROW|IFOSERR(|
|000017e0| 65 72 72 6f 72 29 3b 0d | 09 09 09 69 66 20 28 73 |error);.|...if (s|
|000017f0| 65 74 41 74 74 72 69 62 | 75 74 65 73 29 0d 09 09 |etAttrib|utes)...|
|00001800| 09 7b 0d 09 09 09 09 53 | 65 74 52 65 73 41 74 74 |.{.....S|etResAtt|
|00001810| 72 73 28 64 61 74 61 2c | 20 61 74 74 72 69 62 75 |rs(data,| attribu|
|00001820| 74 65 73 29 3b 0d 09 09 | 09 09 54 48 52 4f 57 49 |tes);...|..THROWI|
|00001830| 46 52 45 53 45 52 52 4f | 52 28 29 3b 0d 09 09 09 |FRESERRO|R();....|
|00001840| 09 43 68 61 6e 67 65 64 | 52 65 73 6f 75 72 63 65 |.Changed|Resource|
|00001850| 28 64 61 74 61 29 3b 0d | 09 09 09 09 54 48 52 4f |(data);.|....THRO|
|00001860| 57 49 46 52 45 53 45 52 | 52 4f 52 28 29 3b 0d 09 |WIFRESER|ROR();..|
|00001870| 09 09 7d 0d 09 09 09 66 | 69 2e 53 75 63 63 65 73 |..}....f|i.Succes|
|00001880| 73 28 29 3b 0d 09 09 7d | 0d 09 09 65 6c 73 65 0d |s();...}|...else.|
|00001890| 09 09 7b 0d 09 09 09 44 | 49 53 50 4f 53 45 49 46 |..{....D|ISPOSEIF|
|000018a0| 48 41 4e 44 4c 45 28 64 | 61 74 61 29 3b 0d 09 09 |HANDLE(d|ata);...|
|000018b0| 09 65 72 72 6f 72 20 3d | 20 66 69 2e 65 72 72 6f |.error =| fi.erro|
|000018c0| 72 3b 0d 09 09 7d 0d 09 | 7d 0d 09 54 48 52 4f 57 |r;...}..|}..THROW|
|000018d0| 49 46 4f 53 45 52 52 28 | 41 45 50 75 74 50 61 72 |IFOSERR(|AEPutPar|
|000018e0| 61 6d 50 74 72 28 72 65 | 70 6c 79 2c 20 6b 65 79 |amPtr(re|ply, key|
|000018f0| 45 72 72 6f 72 4e 75 6d | 62 65 72 2c 20 74 79 70 |ErrorNum|ber, typ|
|00001900| 65 53 68 6f 72 74 49 6e | 74 65 67 65 72 2c 20 28 |eShortIn|teger, (|
|00001910| 50 74 72 29 20 26 65 72 | 72 6f 72 2c 20 73 69 7a |Ptr) &er|ror, siz|
|00001920| 65 6f 66 28 65 72 72 6f | 72 29 29 29 3b 0d 7d 0d |eof(erro|r)));.}.|
|00001930| 0d 0d 2f 2f 09 48 61 6e | 64 6c 65 20 74 68 65 20 |..//.Han|dle the |
|00001940| 63 68 61 6e 67 65 64 20 | 72 65 73 6f 75 72 63 65 |changed |resource|
|00001950| 20 41 70 70 6c 65 45 76 | 65 6e 74 2e 0d 2f 2f 0d | AppleEv|ent..//.|
|00001960| 2f 2f 09 6d 65 73 73 61 | 67 65 3a 09 09 74 68 65 |//.messa|ge:..the|
|00001970| 20 41 70 70 6c 65 45 76 | 65 6e 74 0d 2f 2f 09 72 | AppleEv|ent.//.r|
|00001980| 65 70 6c 79 3a 09 09 09 | 74 68 65 20 72 65 70 6c |eply:...|the repl|
|00001990| 79 20 41 70 70 6c 65 45 | 76 65 6e 74 0d 2f 2f 0d |y AppleE|vent.//.|
|000019a0| 76 6f 69 64 20 54 41 64 | 4c 69 62 4c 69 6e 6b 3a |void TAd|LibLink:|
|000019b0| 3a 43 68 61 6e 67 65 28 | 63 6f 6e 73 74 20 41 70 |:Change(|const Ap|
|000019c0| 70 6c 65 45 76 65 6e 74 | 26 20 6d 65 73 73 61 67 |pleEvent|& messag|
|000019d0| 65 2c 20 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |e, const| AppleEv|
|000019e0| 65 6e 74 26 20 72 65 70 | 6c 79 29 0d 7b 0d 09 73 |ent& rep|ly).{..s|
|000019f0| 68 6f 72 74 20 69 64 3b | 0d 09 52 65 73 54 79 70 |hort id;|..ResTyp|
|00001a00| 65 20 74 79 70 65 3b 0d | 09 44 65 73 63 54 79 70 |e type;.|.DescTyp|
|00001a10| 65 20 61 63 74 75 61 6c | 4d 73 67 54 79 70 65 3b |e actual|MsgType;|
|00001a20| 0d 09 53 69 7a 65 20 73 | 69 7a 65 3b 0d 09 4f 53 |..Size s|ize;..OS|
|00001a30| 45 72 72 20 65 72 72 6f | 72 3b 0d 0d 09 54 48 52 |Err erro|r;...THR|
|00001a40| 4f 57 49 46 4f 53 45 52 | 52 28 41 45 47 65 74 50 |OWIFOSER|R(AEGetP|
|00001a50| 61 72 61 6d 50 74 72 28 | 6d 65 73 73 61 67 65 2c |aramPtr(|message,|
|00001a60| 20 27 52 54 59 50 27 2c | 20 27 52 53 52 43 27 2c | 'RTYP',| 'RSRC',|
|00001a70| 20 61 63 74 75 61 6c 4d | 73 67 54 79 70 65 2c 20 | actualM|sgType, |
|00001a80| 28 50 74 72 29 20 26 74 | 79 70 65 2c 20 73 69 7a |(Ptr) &t|ype, siz|
|00001a90| 65 6f 66 28 74 79 70 65 | 29 2c 20 73 69 7a 65 29 |eof(type|), size)|
|00001aa0| 29 3b 0d 09 54 48 52 4f | 57 49 46 4f 53 45 52 52 |);..THRO|WIFOSERR|
|00001ab0| 28 41 45 47 65 74 50 61 | 72 61 6d 50 74 72 28 6d |(AEGetPa|ramPtr(m|
|00001ac0| 65 73 73 61 67 65 2c 20 | 27 52 49 44 20 27 2c 20 |essage, |'RID ', |
|00001ad0| 74 79 70 65 53 68 6f 72 | 74 49 6e 74 65 67 65 72 |typeShor|tInteger|
|00001ae0| 2c 20 61 63 74 75 61 6c | 4d 73 67 54 79 70 65 2c |, actual|MsgType,|
|00001af0| 20 28 50 74 72 29 20 26 | 69 64 2c 20 73 69 7a 65 | (Ptr) &|id, size|
|00001b00| 6f 66 28 69 64 29 2c 20 | 73 69 7a 65 29 29 3b 0d |of(id), |size));.|
|00001b10| 09 54 48 52 4f 57 49 46 | 4f 53 45 52 52 28 41 45 |.THROWIF|OSERR(AE|
|00001b20| 53 69 7a 65 4f 66 50 61 | 72 61 6d 28 6d 65 73 73 |SizeOfPa|ram(mess|
|00001b30| 61 67 65 2c 20 27 44 41 | 54 41 27 2c 20 61 63 74 |age, 'DA|TA', act|
|00001b40| 75 61 6c 4d 73 67 54 79 | 70 65 2c 20 73 69 7a 65 |ualMsgTy|pe, size|
|00001b50| 29 29 3b 0d 0d 09 73 68 | 6f 72 74 20 63 75 72 52 |));...sh|ort curR|
|00001b60| 73 72 63 46 69 6c 65 20 | 3d 20 55 53 45 52 45 53 |srcFile |= USERES|
|00001b70| 46 49 4c 45 28 67 41 70 | 70 6c 69 63 61 74 69 6f |FILE(gAp|plicatio|
|00001b80| 6e 52 65 66 4e 75 6d 29 | 3b 0d 09 42 6f 6f 6c 65 |nRefNum)|;..Boole|
|00001b90| 61 6e 20 6f 6c 64 50 65 | 72 6d 20 3d 20 50 65 72 |an oldPe|rm = Per|
|00001ba0| 6d 41 6c 6c 6f 63 61 74 | 69 6f 6e 28 54 52 55 45 |mAllocat|ion(TRUE|
|00001bb0| 29 3b 0d 09 48 61 6e 64 | 6c 65 20 72 73 72 63 20 |);..Hand|le rsrc |
|00001bc0| 3d 20 47 65 74 31 52 65 | 73 6f 75 72 63 65 28 74 |= Get1Re|source(t|
|00001bd0| 79 70 65 2c 20 69 64 29 | 3b 0d 09 65 72 72 6f 72 |ype, id)|;..error|
|00001be0| 20 3d 20 52 65 73 45 72 | 72 6f 72 28 29 3b 0d 09 | = ResEr|ror();..|
|00001bf0| 50 65 72 6d 41 6c 6c 6f | 63 61 74 69 6f 6e 28 6f |PermAllo|cation(o|
|00001c00| 6c 64 50 65 72 6d 29 3b | 0d 09 55 53 45 52 45 53 |ldPerm);|..USERES|
|00001c10| 46 49 4c 45 28 63 75 72 | 52 73 72 63 46 69 6c 65 |FILE(cur|RsrcFile|
|00001c20| 29 3b 0d 09 69 66 20 28 | 65 72 72 6f 72 20 3d 3d |);..if (|error ==|
|00001c30| 20 6e 6f 45 72 72 29 0d | 09 7b 0d 09 09 46 61 69 | noErr).|.{...Fai|
|00001c40| 6c 49 6e 66 6f 20 66 69 | 3b 0d 09 09 54 52 59 28 |lInfo fi|;...TRY(|
|00001c50| 66 69 29 0d 09 09 7b 0d | 09 09 09 53 65 74 48 61 |fi)...{.|...SetHa|
|00001c60| 6e 64 6c 65 53 69 7a 65 | 28 72 73 72 63 2c 20 73 |ndleSize|(rsrc, s|
|00001c70| 69 7a 65 29 3b 0d 09 09 | 09 46 61 69 6c 4d 65 6d |ize);...|.FailMem|
|00001c80| 45 72 72 6f 72 28 29 3b | 0d 09 09 09 48 4c 6f 63 |Error();|....HLoc|
|00001c90| 6b 28 72 73 72 63 29 3b | 0d 09 09 09 54 48 52 4f |k(rsrc);|....THRO|
|00001ca0| 57 49 46 4f 53 45 52 52 | 28 41 45 47 65 74 50 61 |WIFOSERR|(AEGetPa|
|00001cb0| 72 61 6d 50 74 72 28 6d | 65 73 73 61 67 65 2c 20 |ramPtr(m|essage, |
|00001cc0| 27 44 41 54 41 27 2c 20 | 27 64 61 74 61 27 2c 20 |'DATA', |'data', |
|00001cd0| 61 63 74 75 61 6c 4d 73 | 67 54 79 70 65 2c 20 2a |actualMs|gType, *|
|00001ce0| 72 73 72 63 2c 20 73 69 | 7a 65 2c 20 73 69 7a 65 |rsrc, si|ze, size|
|00001cf0| 29 29 3b 0d 09 09 09 48 | 55 6e 6c 6f 63 6b 28 72 |));....H|Unlock(r|
|00001d00| 73 72 63 29 3b 0d 09 09 | 09 43 68 61 6e 67 65 64 |src);...|.Changed|
|00001d10| 52 65 73 6f 75 72 63 65 | 28 72 73 72 63 29 3b 0d |Resource|(rsrc);.|
|00001d20| 09 09 09 54 48 52 4f 57 | 49 46 52 45 53 45 52 52 |...THROW|IFRESERR|
|00001d30| 4f 52 28 29 3b 0d 09 09 | 09 66 69 2e 53 75 63 63 |OR();...|.fi.Succ|
|00001d40| 65 73 73 28 29 3b 0d 09 | 09 7d 0d 09 09 65 6c 73 |ess();..|.}...els|
|00001d50| 65 0d 09 09 09 65 72 72 | 6f 72 20 3d 20 66 69 2e |e....err|or = fi.|
|00001d60| 65 72 72 6f 72 3b 0d 09 | 7d 0d 09 54 48 52 4f 57 |error;..|}..THROW|
|00001d70| 49 46 4f 53 45 52 52 28 | 41 45 50 75 74 50 61 72 |IFOSERR(|AEPutPar|
|00001d80| 61 6d 50 74 72 28 72 65 | 70 6c 79 2c 20 6b 65 79 |amPtr(re|ply, key|
|00001d90| 45 72 72 6f 72 4e 75 6d | 62 65 72 2c 20 74 79 70 |ErrorNum|ber, typ|
|00001da0| 65 53 68 6f 72 74 49 6e | 74 65 67 65 72 2c 20 28 |eShortIn|teger, (|
|00001db0| 50 74 72 29 20 26 65 72 | 72 6f 72 2c 20 73 69 7a |Ptr) &er|ror, siz|
|00001dc0| 65 6f 66 28 65 72 72 6f | 72 29 29 29 3b 0d 7d 0d |eof(erro|r)));.}.|
|00001dd0| 0d 0d 2f 2f 09 48 61 6e | 64 6c 65 20 74 68 65 20 |..//.Han|dle the |
|00001de0| 72 65 6d 6f 76 65 20 72 | 65 73 6f 75 72 63 65 20 |remove r|esource |
|00001df0| 41 70 70 6c 65 45 76 65 | 6e 74 2e 0d 2f 2f 0d 2f |AppleEve|nt..//./|
|00001e00| 2f 09 6d 65 73 73 61 67 | 65 3a 09 09 74 68 65 20 |/.messag|e:..the |
|00001e10| 41 70 70 6c 65 45 76 65 | 6e 74 0d 2f 2f 09 72 65 |AppleEve|nt.//.re|
|00001e20| 70 6c 79 3a 09 09 09 74 | 68 65 20 72 65 70 6c 79 |ply:...t|he reply|
|00001e30| 20 41 70 70 6c 65 45 76 | 65 6e 74 0d 2f 2f 0d 76 | AppleEv|ent.//.v|
|00001e40| 6f 69 64 20 54 41 64 4c | 69 62 4c 69 6e 6b 3a 3a |oid TAdL|ibLink::|
|00001e50| 52 65 6d 6f 76 65 28 63 | 6f 6e 73 74 20 41 70 70 |Remove(c|onst App|
|00001e60| 6c 65 45 76 65 6e 74 26 | 20 6d 65 73 73 61 67 65 |leEvent&| message|
|00001e70| 2c 20 63 6f 6e 73 74 20 | 41 70 70 6c 65 45 76 65 |, const |AppleEve|
|00001e80| 6e 74 26 20 72 65 70 6c | 79 29 0d 7b 0d 09 73 68 |nt& repl|y).{..sh|
|00001e90| 6f 72 74 20 69 64 3b 0d | 09 52 65 73 54 79 70 65 |ort id;.|.ResType|
|00001ea0| 20 74 79 70 65 3b 0d 09 | 44 65 73 63 54 79 70 65 | type;..|DescType|
|00001eb0| 20 61 63 74 75 61 6c 4d | 73 67 54 79 70 65 3b 0d | actualM|sgType;.|
|00001ec0| 09 53 69 7a 65 20 73 69 | 7a 65 3b 0d 09 4f 53 45 |.Size si|ze;..OSE|
|00001ed0| 72 72 20 65 72 72 6f 72 | 3b 0d 0d 09 54 48 52 4f |rr error|;...THRO|
|00001ee0| 57 49 46 4f 53 45 52 52 | 28 41 45 47 65 74 50 61 |WIFOSERR|(AEGetPa|
|00001ef0| 72 61 6d 50 74 72 28 6d | 65 73 73 61 67 65 2c 20 |ramPtr(m|essage, |
|00001f00| 27 52 54 59 50 27 2c 20 | 27 52 53 52 43 27 2c 20 |'RTYP', |'RSRC', |
|00001f10| 61 63 74 75 61 6c 4d 73 | 67 54 79 70 65 2c 20 28 |actualMs|gType, (|
|00001f20| 50 74 72 29 20 26 74 79 | 70 65 2c 20 73 69 7a 65 |Ptr) &ty|pe, size|
|00001f30| 6f 66 28 74 79 70 65 29 | 2c 20 73 69 7a 65 29 29 |of(type)|, size))|
|00001f40| 3b 0d 09 54 48 52 4f 57 | 49 46 4f 53 45 52 52 28 |;..THROW|IFOSERR(|
|00001f50| 41 45 47 65 74 50 61 72 | 61 6d 50 74 72 28 6d 65 |AEGetPar|amPtr(me|
|00001f60| 73 73 61 67 65 2c 20 27 | 52 49 44 20 27 2c 20 74 |ssage, '|RID ', t|
|00001f70| 79 70 65 53 68 6f 72 74 | 49 6e 74 65 67 65 72 2c |ypeShort|Integer,|
|00001f80| 20 61 63 74 75 61 6c 4d | 73 67 54 79 70 65 2c 20 | actualM|sgType, |
|00001f90| 28 50 74 72 29 20 26 69 | 64 2c 20 73 69 7a 65 6f |(Ptr) &i|d, sizeo|
|00001fa0| 66 28 69 64 29 2c 20 73 | 69 7a 65 29 29 3b 0d 0d |f(id), s|ize));..|
|00001fb0| 09 73 68 6f 72 74 20 63 | 75 72 52 73 72 63 46 69 |.short c|urRsrcFi|
|00001fc0| 6c 65 20 3d 20 55 53 45 | 52 45 53 46 49 4c 45 28 |le = USE|RESFILE(|
|00001fd0| 67 41 70 70 6c 69 63 61 | 74 69 6f 6e 52 65 66 4e |gApplica|tionRefN|
|00001fe0| 75 6d 29 3b 0d 09 42 6f | 6f 6c 65 61 6e 20 63 75 |um);..Bo|olean cu|
|00001ff0| 72 52 65 73 4c 6f 61 64 | 20 3d 20 4c 4d 47 65 74 |rResLoad| = LMGet|
|00002000| 52 65 73 4c 6f 61 64 28 | 29 3b 0d 09 53 65 74 52 |ResLoad(|);..SetR|
|00002010| 65 73 4c 6f 61 64 28 46 | 41 4c 53 45 29 3b 0d 09 |esLoad(F|ALSE);..|
|00002020| 48 61 6e 64 6c 65 20 72 | 73 72 63 20 3d 20 47 65 |Handle r|src = Ge|
|00002030| 74 31 52 65 73 6f 75 72 | 63 65 28 74 79 70 65 2c |t1Resour|ce(type,|
|00002040| 20 69 64 29 3b 0d 09 65 | 72 72 6f 72 20 3d 20 52 | id);..e|rror = R|
|00002050| 65 73 45 72 72 6f 72 28 | 29 3b 0d 09 53 65 74 52 |esError(|);..SetR|
|00002060| 65 73 4c 6f 61 64 28 63 | 75 72 52 65 73 4c 6f 61 |esLoad(c|urResLoa|
|00002070| 64 29 3b 0d 09 69 66 20 | 28 65 72 72 6f 72 20 3d |d);..if |(error =|
|00002080| 3d 20 6e 6f 45 72 72 29 | 0d 09 7b 0d 09 09 52 65 |= noErr)|..{...Re|
|00002090| 6d 6f 76 65 52 65 73 6f | 75 72 63 65 28 72 73 72 |moveReso|urce(rsr|
|000020a0| 63 29 3b 0d 09 09 65 72 | 72 6f 72 20 3d 20 52 65 |c);...er|ror = Re|
|000020b0| 73 45 72 72 6f 72 28 29 | 3b 0d 09 7d 0d 09 55 53 |sError()|;..}..US|
|000020c0| 45 52 45 53 46 49 4c 45 | 28 63 75 72 52 73 72 63 |ERESFILE|(curRsrc|
|000020d0| 46 69 6c 65 29 3b 0d 09 | 54 48 52 4f 57 49 46 4f |File);..|THROWIFO|
|000020e0| 53 45 52 52 28 41 45 50 | 75 74 50 61 72 61 6d 50 |SERR(AEP|utParamP|
|000020f0| 74 72 28 72 65 70 6c 79 | 2c 20 6b 65 79 45 72 72 |tr(reply|, keyErr|
|00002100| 6f 72 4e 75 6d 62 65 72 | 2c 20 74 79 70 65 53 68 |orNumber|, typeSh|
|00002110| 6f 72 74 49 6e 74 65 67 | 65 72 2c 20 28 50 74 72 |ortInteg|er, (Ptr|
|00002120| 29 20 26 65 72 72 6f 72 | 2c 20 73 69 7a 65 6f 66 |) &error|, sizeof|
|00002130| 28 65 72 72 6f 72 29 29 | 29 3b 0d 7d 0d 0d 0d 2f |(error))|);.}.../|
|00002140| 2f 09 48 61 6e 64 6c 65 | 20 74 68 65 20 73 65 74 |/.Handle| the set|
|00002150| 20 72 65 73 6f 75 72 63 | 65 20 69 6e 66 6f 20 41 | resourc|e info A|
|00002160| 70 70 6c 65 45 76 65 6e | 74 2e 0d 2f 2f 0d 2f 2f |ppleEven|t..//.//|
|00002170| 09 6d 65 73 73 61 67 65 | 3a 09 09 74 68 65 20 41 |.message|:..the A|
|00002180| 70 70 6c 65 45 76 65 6e | 74 0d 2f 2f 09 72 65 70 |ppleEven|t.//.rep|
|00002190| 6c 79 3a 09 09 09 74 68 | 65 20 72 65 70 6c 79 20 |ly:...th|e reply |
|000021a0| 41 70 70 6c 65 45 76 65 | 6e 74 0d 2f 2f 0d 76 6f |AppleEve|nt.//.vo|
|000021b0| 69 64 20 54 41 64 4c 69 | 62 4c 69 6e 6b 3a 3a 53 |id TAdLi|bLink::S|
|000021c0| 65 74 28 63 6f 6e 73 74 | 20 41 70 70 6c 65 45 76 |et(const| AppleEv|
|000021d0| 65 6e 74 26 20 6d 65 73 | 73 61 67 65 2c 20 63 6f |ent& mes|sage, co|
|000021e0| 6e 73 74 20 41 70 70 6c | 65 45 76 65 6e 74 26 20 |nst Appl|eEvent& |
|000021f0| 72 65 70 6c 79 29 0d 7b | 0d 09 73 68 6f 72 74 20 |reply).{|..short |
|00002200| 6f 6c 64 49 44 2c 20 6e | 65 77 49 44 3b 0d 09 52 |oldID, n|ewID;..R|
|00002210| 65 73 54 79 70 65 20 74 | 79 70 65 3b 0d 09 43 53 |esType t|ype;..CS|
|00002220| 74 72 32 35 35 20 6e 61 | 6d 65 3b 0d 09 44 65 73 |tr255 na|me;..Des|
|00002230| 63 54 79 70 65 20 61 63 | 74 75 61 6c 4d 73 67 54 |cType ac|tualMsgT|
|00002240| 79 70 65 3b 0d 09 53 69 | 7a 65 20 73 69 7a 65 3b |ype;..Si|ze size;|
|00002250| 0d 09 4f 53 45 72 72 20 | 65 72 72 6f 72 3b 0d 0d |..OSErr |error;..|
|00002260| 09 54 48 52 4f 57 49 46 | 4f 53 45 52 52 28 41 45 |.THROWIF|OSERR(AE|
|00002270| 47 65 74 50 61 72 61 6d | 50 74 72 28 6d 65 73 73 |GetParam|Ptr(mess|
|00002280| 61 67 65 2c 20 27 52 54 | 59 50 27 2c 20 27 52 53 |age, 'RT|YP', 'RS|
|00002290| 52 43 27 2c 20 61 63 74 | 75 61 6c 4d 73 67 54 79 |RC', act|ualMsgTy|
|000022a0| 70 65 2c 20 28 50 74 72 | 29 20 26 74 79 70 65 2c |pe, (Ptr|) &type,|
|000022b0| 20 73 69 7a 65 6f 66 28 | 74 79 70 65 29 2c 20 73 | sizeof(|type), s|
|000022c0| 69 7a 65 29 29 3b 0d 09 | 54 48 52 4f 57 49 46 4f |ize));..|THROWIFO|
|000022d0| 53 45 52 52 28 41 45 47 | 65 74 50 61 72 61 6d 50 |SERR(AEG|etParamP|
|000022e0| 74 72 28 6d 65 73 73 61 | 67 65 2c 20 27 52 49 44 |tr(messa|ge, 'RID|
|000022f0| 20 27 2c 20 74 79 70 65 | 53 68 6f 72 74 49 6e 74 | ', type|ShortInt|
|00002300| 65 67 65 72 2c 20 61 63 | 74 75 61 6c 4d 73 67 54 |eger, ac|tualMsgT|
|00002310| 79 70 65 2c 20 28 50 74 | 72 29 20 26 6f 6c 64 49 |ype, (Pt|r) &oldI|
|00002320| 44 2c 20 73 69 7a 65 6f | 66 28 6f 6c 64 49 44 29 |D, sizeo|f(oldID)|
|00002330| 2c 20 73 69 7a 65 29 29 | 3b 0d 09 54 48 52 4f 57 |, size))|;..THROW|
|00002340| 49 46 4f 53 45 52 52 28 | 41 45 47 65 74 50 61 72 |IFOSERR(|AEGetPar|
|00002350| 61 6d 50 74 72 28 6d 65 | 73 73 61 67 65 2c 20 27 |amPtr(me|ssage, '|
|00002360| 49 44 20 20 27 2c 20 74 | 79 70 65 53 68 6f 72 74 |ID ', t|ypeShort|
|00002370| 49 6e 74 65 67 65 72 2c | 20 61 63 74 75 61 6c 4d |Integer,| actualM|
|00002380| 73 67 54 79 70 65 2c 20 | 28 50 74 72 29 20 26 6e |sgType, |(Ptr) &n|
|00002390| 65 77 49 44 2c 20 73 69 | 7a 65 6f 66 28 6e 65 77 |ewID, si|zeof(new|
|000023a0| 49 44 29 2c 20 73 69 7a | 65 29 29 3b 0d 09 54 48 |ID), siz|e));..TH|
|000023b0| 52 4f 57 49 46 4f 53 45 | 52 52 28 41 45 47 65 74 |ROWIFOSE|RR(AEGet|
|000023c0| 50 61 72 61 6d 50 74 72 | 28 6d 65 73 73 61 67 65 |ParamPtr|(message|
|000023d0| 2c 20 27 4e 41 4d 45 27 | 2c 20 74 79 70 65 43 68 |, 'NAME'|, typeCh|
|000023e0| 61 72 2c 20 61 63 74 75 | 61 6c 4d 73 67 54 79 70 |ar, actu|alMsgTyp|
|000023f0| 65 2c 20 28 50 74 72 29 | 20 26 6e 61 6d 65 5b 31 |e, (Ptr)| &name[1|
|00002400| 5d 2c 20 73 69 7a 65 6f | 66 28 6e 61 6d 65 29 20 |], sizeo|f(name) |
|00002410| 2d 20 31 2c 20 73 69 7a | 65 29 29 3b 0d 09 6e 61 |- 1, siz|e));..na|
|00002420| 6d 65 2e 4c 65 6e 67 74 | 68 28 29 20 3d 20 28 63 |me.Lengt|h() = (c|
|00002430| 68 61 72 29 20 73 69 7a | 65 3b 0d 0d 09 73 68 6f |har) siz|e;...sho|
|00002440| 72 74 20 63 75 72 52 73 | 72 63 46 69 6c 65 20 3d |rt curRs|rcFile =|
|00002450| 20 55 53 45 52 45 53 46 | 49 4c 45 28 67 41 70 70 | USERESF|ILE(gApp|
|00002460| 6c 69 63 61 74 69 6f 6e | 52 65 66 4e 75 6d 29 3b |lication|RefNum);|
|00002470| 0d 09 42 6f 6f 6c 65 61 | 6e 20 63 75 72 52 65 73 |..Boolea|n curRes|
|00002480| 4c 6f 61 64 20 3d 20 4c | 4d 47 65 74 52 65 73 4c |Load = L|MGetResL|
|00002490| 6f 61 64 28 29 3b 0d 09 | 53 65 74 52 65 73 4c 6f |oad();..|SetResLo|
|000024a0| 61 64 28 46 41 4c 53 45 | 29 3b 0d 09 48 61 6e 64 |ad(FALSE|);..Hand|
|000024b0| 6c 65 20 72 73 72 63 20 | 3d 20 47 65 74 31 52 65 |le rsrc |= Get1Re|
|000024c0| 73 6f 75 72 63 65 28 74 | 79 70 65 2c 20 6f 6c 64 |source(t|ype, old|
|000024d0| 49 44 29 3b 0d 09 65 72 | 72 6f 72 20 3d 20 52 65 |ID);..er|ror = Re|
|000024e0| 73 45 72 72 6f 72 28 29 | 3b 0d 09 53 65 74 52 65 |sError()|;..SetRe|
|000024f0| 73 4c 6f 61 64 28 63 75 | 72 52 65 73 4c 6f 61 64 |sLoad(cu|rResLoad|
|00002500| 29 3b 0d 09 69 66 20 28 | 65 72 72 6f 72 20 3d 3d |);..if (|error ==|
|00002510| 20 6e 6f 45 72 72 29 0d | 09 7b 0d 09 09 53 65 74 | noErr).|.{...Set|
|00002520| 52 65 73 49 6e 66 6f 28 | 72 73 72 63 2c 20 6e 65 |ResInfo(|rsrc, ne|
|00002530| 77 49 44 2c 20 6e 61 6d | 65 29 3b 0d 09 09 65 72 |wID, nam|e);...er|
|00002540| 72 6f 72 20 3d 20 52 65 | 73 45 72 72 6f 72 28 29 |ror = Re|sError()|
|00002550| 3b 0d 09 7d 0d 09 55 53 | 45 52 45 53 46 49 4c 45 |;..}..US|ERESFILE|
|00002560| 28 63 75 72 52 73 72 63 | 46 69 6c 65 29 3b 0d 09 |(curRsrc|File);..|
|00002570| 54 48 52 4f 57 49 46 4f | 53 45 52 52 28 41 45 50 |THROWIFO|SERR(AEP|
|00002580| 75 74 50 61 72 61 6d 50 | 74 72 28 72 65 70 6c 79 |utParamP|tr(reply|
|00002590| 2c 20 6b 65 79 45 72 72 | 6f 72 4e 75 6d 62 65 72 |, keyErr|orNumber|
|000025a0| 2c 20 74 79 70 65 53 68 | 6f 72 74 49 6e 74 65 67 |, typeSh|ortInteg|
|000025b0| 65 72 2c 20 28 50 74 72 | 29 20 26 65 72 72 6f 72 |er, (Ptr|) &error|
|000025c0| 2c 20 73 69 7a 65 6f 66 | 28 65 72 72 6f 72 29 29 |, sizeof|(error))|
|000025d0| 29 3b 0d 7d 0d 0d 23 65 | 6c 73 65 0d 0d 2f 2f 09 |);.}..#e|lse..//.|
|000025e0| 48 61 6e 64 6c 65 20 74 | 68 65 20 61 64 64 20 72 |Handle t|he add r|
|000025f0| 65 73 6f 75 72 63 65 20 | 41 70 70 6c 65 45 76 65 |esource |AppleEve|
|00002600| 6e 74 2e 0d 2f 2f 0d 2f | 2f 09 6d 65 73 73 61 67 |nt..//./|/.messag|
|00002610| 65 3a 09 09 74 68 65 20 | 41 70 70 6c 65 45 76 65 |e:..the |AppleEve|
|00002620| 6e 74 0d 2f 2f 09 72 65 | 70 6c 79 3a 09 09 09 74 |nt.//.re|ply:...t|
|00002630| 68 65 20 72 65 70 6c 79 | 20 41 70 70 6c 65 45 76 |he reply| AppleEv|
|00002640| 65 6e 74 0d 2f 2f 0d 76 | 6f 69 64 20 54 41 64 4c |ent.//.v|oid TAdL|
|00002650| 69 62 4c 69 6e 6b 3a 3a | 41 64 64 28 63 6f 6e 73 |ibLink::|Add(cons|
|00002660| 74 20 41 70 70 6c 65 45 | 76 65 6e 74 26 20 6d 65 |t AppleE|vent& me|
|00002670| 73 73 61 67 65 2c 20 41 | 70 70 6c 65 45 76 65 6e |ssage, A|ppleEven|
|00002680| 74 26 20 72 65 70 6c 79 | 29 0d 7b 0d 09 73 68 6f |t& reply|).{..sho|
|00002690| 72 74 20 69 64 2c 20 61 | 74 74 72 69 62 75 74 65 |rt id, a|ttribute|
|000026a0| 73 3b 0d 09 52 65 73 54 | 79 70 65 20 74 79 70 65 |s;..ResT|ype type|
|000026b0| 3b 0d 09 44 65 73 63 54 | 79 70 65 20 61 63 74 75 |;..DescT|ype actu|
|000026c0| 61 6c 4d 73 67 54 79 70 | 65 3b 0d 09 53 69 7a 65 |alMsgTyp|e;..Size|
|000026d0| 20 73 69 7a 65 3b 0d 0d | 09 54 48 52 4f 57 49 46 | size;..|.THROWIF|
|000026e0| 4f 53 45 52 52 28 41 45 | 47 65 74 50 61 72 61 6d |OSERR(AE|GetParam|
|000026f0| 50 74 72 28 26 6d 65 73 | 73 61 67 65 2c 20 27 52 |Ptr(&mes|sage, 'R|
|00002700| 54 59 50 27 2c 20 27 52 | 53 52 43 27 2c 20 26 61 |TYP', 'R|SRC', &a|
|00002710| 63 74 75 61 6c 4d 73 67 | 54 79 70 65 2c 20 26 74 |ctualMsg|Type, &t|
|00002720| 79 70 65 2c 20 73 69 7a | 65 6f 66 28 74 79 70 65 |ype, siz|eof(type|
|00002730| 29 2c 20 26 73 69 7a 65 | 29 29 3b 0d 09 54 48 52 |), &size|));..THR|
|00002740| 4f 57 49 46 4f 53 45 52 | 52 28 41 45 47 65 74 50 |OWIFOSER|R(AEGetP|
|00002750| 61 72 61 6d 50 74 72 28 | 26 6d 65 73 73 61 67 65 |aramPtr(|&message|
|00002760| 2c 20 27 52 49 44 20 27 | 2c 20 74 79 70 65 53 68 |, 'RID '|, typeSh|
|00002770| 6f 72 74 49 6e 74 65 67 | 65 72 2c 20 26 61 63 74 |ortInteg|er, &act|
|00002780| 75 61 6c 4d 73 67 54 79 | 70 65 2c 20 26 69 64 2c |ualMsgTy|pe, &id,|
|00002790| 20 73 69 7a 65 6f 66 28 | 69 64 29 2c 20 26 73 69 | sizeof(|id), &si|
|000027a0| 7a 65 29 29 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |ze));..O|SErr err|
|000027b0| 6f 72 20 3d 20 41 45 47 | 65 74 50 61 72 61 6d 50 |or = AEG|etParamP|
|000027c0| 74 72 28 26 6d 65 73 73 | 61 67 65 2c 20 27 41 54 |tr(&mess|age, 'AT|
|000027d0| 54 52 27 2c 20 74 79 70 | 65 53 68 6f 72 74 49 6e |TR', typ|eShortIn|
|000027e0| 74 65 67 65 72 2c 20 26 | 61 63 74 75 61 6c 4d 73 |teger, &|actualMs|
|000027f0| 67 54 79 70 65 2c 20 26 | 61 74 74 72 69 62 75 74 |gType, &|attribut|
|00002800| 65 73 2c 20 73 69 7a 65 | 6f 66 28 69 64 29 2c 20 |es, size|of(id), |
|00002810| 26 73 69 7a 65 29 3b 0d | 09 42 6f 6f 6c 65 61 6e |&size);.|.Boolean|
|00002820| 20 73 65 74 41 74 74 72 | 69 62 75 74 65 73 20 3d | setAttr|ibutes =|
|00002830| 20 28 65 72 72 6f 72 20 | 3d 3d 20 6e 6f 45 72 72 | (error |== noErr|
|00002840| 29 3b 0d 09 69 66 20 28 | 65 72 72 6f 72 20 3d 3d |);..if (|error ==|
|00002850| 20 65 72 72 41 45 44 65 | 73 63 4e 6f 74 46 6f 75 | errAEDe|scNotFou|
|00002860| 6e 64 29 0d 09 09 65 72 | 72 6f 72 20 3d 20 6e 6f |nd)...er|ror = no|
|00002870| 45 72 72 3b 0d 09 54 48 | 52 4f 57 49 46 4f 53 45 |Err;..TH|ROWIFOSE|
|00002880| 52 52 28 65 72 72 6f 72 | 29 3b 0d 09 54 48 52 4f |RR(error|);..THRO|
|00002890| 57 49 46 4f 53 45 52 52 | 28 41 45 53 69 7a 65 4f |WIFOSERR|(AESizeO|
|000028a0| 66 50 61 72 61 6d 28 26 | 6d 65 73 73 61 67 65 2c |fParam(&|message,|
|000028b0| 20 27 44 41 54 41 27 2c | 20 26 61 63 74 75 61 6c | 'DATA',| &actual|
|000028c0| 4d 73 67 54 79 70 65 2c | 20 26 73 69 7a 65 29 29 |MsgType,| &size))|
|000028d0| 3b 0d 0d 09 69 66 20 28 | 73 69 7a 65 20 3e 20 30 |;...if (|size > 0|
|000028e0| 29 0d 09 7b 0d 09 09 4d | 41 56 6f 6c 61 74 69 6c |)..{...M|AVolatil|
|000028f0| 65 49 6e 69 74 28 48 61 | 6e 64 6c 65 2c 20 64 61 |eInit(Ha|ndle, da|
|00002900| 74 61 2c 20 4e 55 4c 4c | 29 3b 0d 23 69 66 20 71 |ta, NULL|);.#if q|
|00002910| 4d 61 63 41 70 70 56 65 | 72 73 69 6f 6e 20 3c 3d |MacAppVe|rsion <=|
|00002920| 20 33 33 0d 09 09 46 61 | 69 6c 49 6e 66 6f 20 66 | 33...Fa|ilInfo f|
|00002930| 69 3b 0d 09 09 54 52 59 | 28 66 69 29 0d 23 65 6c |i;...TRY|(fi).#el|
|00002940| 73 65 0d 09 09 74 72 79 | 0d 23 65 6e 64 69 66 0d |se...try|.#endif.|
|00002950| 09 09 7b 0d 09 09 09 64 | 61 74 61 20 3d 20 4e 65 |..{....d|ata = Ne|
|00002960| 77 50 65 72 6d 48 61 6e | 64 6c 65 28 73 69 7a 65 |wPermHan|dle(size|
|00002970| 29 3b 0d 09 09 09 48 4c | 6f 63 6b 28 64 61 74 61 |);....HL|ock(data|
|00002980| 29 3b 0d 09 09 09 54 48 | 52 4f 57 49 46 4f 53 45 |);....TH|ROWIFOSE|
|00002990| 52 52 28 41 45 47 65 74 | 50 61 72 61 6d 50 74 72 |RR(AEGet|ParamPtr|
|000029a0| 28 26 6d 65 73 73 61 67 | 65 2c 20 27 44 41 54 41 |(&messag|e, 'DATA|
|000029b0| 27 2c 20 27 64 61 74 61 | 27 2c 20 26 61 63 74 75 |', 'data|', &actu|
|000029c0| 61 6c 4d 73 67 54 79 70 | 65 2c 20 2a 64 61 74 61 |alMsgTyp|e, *data|
|000029d0| 2c 20 73 69 7a 65 2c 20 | 26 73 69 7a 65 29 29 3b |, size, |&size));|
|000029e0| 0d 09 09 09 48 55 6e 6c | 6f 63 6b 28 64 61 74 61 |....HUnl|ock(data|
|000029f0| 29 3b 0d 09 09 09 73 68 | 6f 72 74 20 63 75 72 52 |);....sh|ort curR|
|00002a00| 73 72 63 46 69 6c 65 20 | 3d 20 55 53 45 52 45 53 |srcFile |= USERES|
|00002a10| 46 49 4c 45 28 67 41 70 | 70 6c 69 63 61 74 69 6f |FILE(gAp|plicatio|
|00002a20| 6e 52 65 66 4e 75 6d 29 | 3b 0d 09 09 09 41 64 64 |nRefNum)|;....Add|
|00002a30| 52 65 73 6f 75 72 63 65 | 28 64 61 74 61 2c 20 74 |Resource|(data, t|
|00002a40| 79 70 65 2c 20 69 64 2c | 20 67 45 6d 70 74 79 53 |ype, id,| gEmptyS|
|00002a50| 74 72 69 6e 67 29 3b 0d | 09 09 09 65 72 72 6f 72 |tring);.|...error|
|00002a60| 20 3d 20 52 65 73 45 72 | 72 6f 72 28 29 3b 0d 09 | = ResEr|ror();..|
|00002a70| 09 09 55 53 45 52 45 53 | 46 49 4c 45 28 63 75 72 |..USERES|FILE(cur|
|00002a80| 52 73 72 63 46 69 6c 65 | 29 3b 0d 09 09 09 54 48 |RsrcFile|);....TH|
|00002a90| 52 4f 57 49 46 4f 53 45 | 52 52 28 65 72 72 6f 72 |ROWIFOSE|RR(error|
|00002aa0| 29 3b 0d 09 09 09 69 66 | 20 28 73 65 74 41 74 74 |);....if| (setAtt|
|00002ab0| 72 69 62 75 74 65 73 29 | 0d 09 09 09 7b 0d 09 09 |ributes)|....{...|
|00002ac0| 09 09 53 65 74 52 65 73 | 41 74 74 72 73 28 64 61 |..SetRes|Attrs(da|
|00002ad0| 74 61 2c 20 61 74 74 72 | 69 62 75 74 65 73 29 3b |ta, attr|ibutes);|
|00002ae0| 0d 09 09 09 09 54 48 52 | 4f 57 49 46 52 45 53 45 |.....THR|OWIFRESE|
|00002af0| 52 52 4f 52 28 29 3b 0d | 09 09 09 09 43 68 61 6e |RROR();.|....Chan|
|00002b00| 67 65 64 52 65 73 6f 75 | 72 63 65 28 64 61 74 61 |gedResou|rce(data|
|00002b10| 29 3b 0d 09 09 09 09 54 | 48 52 4f 57 49 46 52 45 |);.....T|HROWIFRE|
|00002b20| 53 45 52 52 4f 52 28 29 | 3b 0d 09 09 09 7d 0d 23 |SERROR()|;....}.#|
|00002b30| 69 66 20 71 4d 61 63 41 | 70 70 56 65 72 73 69 6f |if qMacA|ppVersio|
|00002b40| 6e 20 3c 3d 20 33 33 0d | 09 09 09 66 69 2e 53 75 |n <= 33.|...fi.Su|
|00002b50| 63 63 65 73 73 28 29 3b | 0d 23 65 6e 64 69 66 0d |ccess();|.#endif.|
|00002b60| 09 09 7d 0d 23 69 66 20 | 71 4d 61 63 41 70 70 56 |..}.#if |qMacAppV|
|00002b70| 65 72 73 69 6f 6e 20 3c | 3d 20 33 33 0d 09 09 65 |ersion <|= 33...e|
|00002b80| 6c 73 65 0d 23 65 6c 73 | 65 0d 09 09 63 61 74 63 |lse.#els|e...catc|
|00002b90| 68 20 28 43 45 78 63 65 | 70 74 69 6f 6e 5f 41 43 |h (CExce|ption_AC|
|00002ba0| 26 20 74 68 65 45 78 63 | 65 70 74 69 6f 6e 29 0d |& theExc|eption).|
|00002bb0| 23 65 6e 64 69 66 0d 09 | 09 7b 0d 09 09 09 44 49 |#endif..|.{....DI|
|00002bc0| 53 50 4f 53 45 49 46 48 | 41 4e 44 4c 45 28 64 61 |SPOSEIFH|ANDLE(da|
|00002bd0| 74 61 29 3b 0d 23 69 66 | 20 71 4d 61 63 41 70 70 |ta);.#if| qMacApp|
|00002be0| 56 65 72 73 69 6f 6e 20 | 3c 3d 20 33 33 0d 09 09 |Version |<= 33...|
|00002bf0| 09 65 72 72 6f 72 20 3d | 20 66 69 2e 65 72 72 6f |.error =| fi.erro|
|00002c00| 72 3b 0d 23 65 6c 73 65 | 0d 09 09 09 65 72 72 6f |r;.#else|....erro|
|00002c10| 72 20 3d 20 74 68 65 45 | 78 63 65 70 74 69 6f 6e |r = theE|xception|
|00002c20| 2e 47 65 74 45 72 72 6f | 72 28 29 3b 0d 23 65 6e |.GetErro|r();.#en|
|00002c30| 64 69 66 0d 09 09 7d 0d | 09 7d 0d 09 54 48 52 4f |dif...}.|.}..THRO|
|00002c40| 57 49 46 4f 53 45 52 52 | 28 41 45 50 75 74 50 61 |WIFOSERR|(AEPutPa|
|00002c50| 72 61 6d 50 74 72 28 26 | 72 65 70 6c 79 2c 20 6b |ramPtr(&|reply, k|
|00002c60| 65 79 45 72 72 6f 72 4e | 75 6d 62 65 72 2c 20 74 |eyErrorN|umber, t|
|00002c70| 79 70 65 53 68 6f 72 74 | 49 6e 74 65 67 65 72 2c |ypeShort|Integer,|
|00002c80| 20 26 65 72 72 6f 72 2c | 20 73 69 7a 65 6f 66 28 | &error,| sizeof(|
|00002c90| 65 72 72 6f 72 29 29 29 | 3b 0d 7d 0d 0d 0d 2f 2f |error)))|;.}...//|
|00002ca0| 09 48 61 6e 64 6c 65 20 | 74 68 65 20 63 68 61 6e |.Handle |the chan|
|00002cb0| 67 65 64 20 72 65 73 6f | 75 72 63 65 20 41 70 70 |ged reso|urce App|
|00002cc0| 6c 65 45 76 65 6e 74 2e | 0d 2f 2f 0d 2f 2f 09 6d |leEvent.|.//.//.m|
|00002cd0| 65 73 73 61 67 65 3a 09 | 09 74 68 65 20 41 70 70 |essage:.|.the App|
|00002ce0| 6c 65 45 76 65 6e 74 0d | 2f 2f 09 72 65 70 6c 79 |leEvent.|//.reply|
|00002cf0| 3a 09 09 09 74 68 65 20 | 72 65 70 6c 79 20 41 70 |:...the |reply Ap|
|00002d00| 70 6c 65 45 76 65 6e 74 | 0d 2f 2f 0d 76 6f 69 64 |pleEvent|.//.void|
|00002d10| 20 54 41 64 4c 69 62 4c | 69 6e 6b 3a 3a 43 68 61 | TAdLibL|ink::Cha|
|00002d20| 6e 67 65 28 63 6f 6e 73 | 74 20 41 70 70 6c 65 45 |nge(cons|t AppleE|
|00002d30| 76 65 6e 74 26 20 6d 65 | 73 73 61 67 65 2c 20 41 |vent& me|ssage, A|
|00002d40| 70 70 6c 65 45 76 65 6e | 74 26 20 72 65 70 6c 79 |ppleEven|t& reply|
|00002d50| 29 0d 7b 0d 09 73 68 6f | 72 74 20 69 64 3b 0d 09 |).{..sho|rt id;..|
|00002d60| 52 65 73 54 79 70 65 20 | 74 79 70 65 3b 0d 09 44 |ResType |type;..D|
|00002d70| 65 73 63 54 79 70 65 20 | 61 63 74 75 61 6c 4d 73 |escType |actualMs|
|00002d80| 67 54 79 70 65 3b 0d 09 | 53 69 7a 65 20 73 69 7a |gType;..|Size siz|
|00002d90| 65 3b 0d 09 4f 53 45 72 | 72 20 65 72 72 6f 72 3b |e;..OSEr|r error;|
|00002da0| 0d 0d 09 54 48 52 4f 57 | 49 46 4f 53 45 52 52 28 |...THROW|IFOSERR(|
|00002db0| 41 45 47 65 74 50 61 72 | 61 6d 50 74 72 28 26 6d |AEGetPar|amPtr(&m|
|00002dc0| 65 73 73 61 67 65 2c 20 | 27 52 54 59 50 27 2c 20 |essage, |'RTYP', |
|00002dd0| 27 52 53 52 43 27 2c 20 | 26 61 63 74 75 61 6c 4d |'RSRC', |&actualM|
|00002de0| 73 67 54 79 70 65 2c 20 | 26 74 79 70 65 2c 20 73 |sgType, |&type, s|
|00002df0| 69 7a 65 6f 66 28 74 79 | 70 65 29 2c 20 26 73 69 |izeof(ty|pe), &si|
|00002e00| 7a 65 29 29 3b 0d 09 54 | 48 52 4f 57 49 46 4f 53 |ze));..T|HROWIFOS|
|00002e10| 45 52 52 28 41 45 47 65 | 74 50 61 72 61 6d 50 74 |ERR(AEGe|tParamPt|
|00002e20| 72 28 26 6d 65 73 73 61 | 67 65 2c 20 27 52 49 44 |r(&messa|ge, 'RID|
|00002e30| 20 27 2c 20 74 79 70 65 | 53 68 6f 72 74 49 6e 74 | ', type|ShortInt|
|00002e40| 65 67 65 72 2c 20 26 61 | 63 74 75 61 6c 4d 73 67 |eger, &a|ctualMsg|
|00002e50| 54 79 70 65 2c 20 26 69 | 64 2c 20 73 69 7a 65 6f |Type, &i|d, sizeo|
|00002e60| 66 28 69 64 29 2c 20 26 | 73 69 7a 65 29 29 3b 0d |f(id), &|size));.|
|00002e70| 09 54 48 52 4f 57 49 46 | 4f 53 45 52 52 28 41 45 |.THROWIF|OSERR(AE|
|00002e80| 53 69 7a 65 4f 66 50 61 | 72 61 6d 28 26 6d 65 73 |SizeOfPa|ram(&mes|
|00002e90| 73 61 67 65 2c 20 27 44 | 41 54 41 27 2c 20 26 61 |sage, 'D|ATA', &a|
|00002ea0| 63 74 75 61 6c 4d 73 67 | 54 79 70 65 2c 20 26 73 |ctualMsg|Type, &s|
|00002eb0| 69 7a 65 29 29 3b 0d 0d | 09 73 68 6f 72 74 20 63 |ize));..|.short c|
|00002ec0| 75 72 52 73 72 63 46 69 | 6c 65 20 3d 20 55 53 45 |urRsrcFi|le = USE|
|00002ed0| 52 45 53 46 49 4c 45 28 | 67 41 70 70 6c 69 63 61 |RESFILE(|gApplica|
|00002ee0| 74 69 6f 6e 52 65 66 4e | 75 6d 29 3b 0d 09 42 6f |tionRefN|um);..Bo|
|00002ef0| 6f 6c 65 61 6e 20 6f 6c | 64 50 65 72 6d 20 3d 20 |olean ol|dPerm = |
|00002f00| 50 65 72 6d 41 6c 6c 6f | 63 61 74 69 6f 6e 28 54 |PermAllo|cation(T|
|00002f10| 52 55 45 29 3b 0d 09 48 | 61 6e 64 6c 65 20 72 73 |RUE);..H|andle rs|
|00002f20| 72 63 20 3d 20 47 65 74 | 31 52 65 73 6f 75 72 63 |rc = Get|1Resourc|
|00002f30| 65 28 74 79 70 65 2c 20 | 69 64 29 3b 0d 09 65 72 |e(type, |id);..er|
|00002f40| 72 6f 72 20 3d 20 52 65 | 73 45 72 72 6f 72 28 29 |ror = Re|sError()|
|00002f50| 3b 0d 09 50 65 72 6d 41 | 6c 6c 6f 63 61 74 69 6f |;..PermA|llocatio|
|00002f60| 6e 28 6f 6c 64 50 65 72 | 6d 29 3b 0d 09 55 53 45 |n(oldPer|m);..USE|
|00002f70| 52 45 53 46 49 4c 45 28 | 63 75 72 52 73 72 63 46 |RESFILE(|curRsrcF|
|00002f80| 69 6c 65 29 3b 0d 09 69 | 66 20 28 65 72 72 6f 72 |ile);..i|f (error|
|00002f90| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 7b 0d 23 69 | == noEr|r)..{.#i|
|00002fa0| 66 20 71 4d 61 63 41 70 | 70 56 65 72 73 69 6f 6e |f qMacAp|pVersion|
|00002fb0| 20 3c 3d 20 33 33 0d 09 | 09 46 61 69 6c 49 6e 66 | <= 33..|.FailInf|
|00002fc0| 6f 20 66 69 3b 0d 09 09 | 54 52 59 28 66 69 29 0d |o fi;...|TRY(fi).|
|00002fd0| 23 65 6c 73 65 0d 09 09 | 74 72 79 0d 23 65 6e 64 |#else...|try.#end|
|00002fe0| 69 66 0d 09 09 7b 0d 09 | 09 09 53 65 74 48 61 6e |if...{..|..SetHan|
|00002ff0| 64 6c 65 53 69 7a 65 28 | 72 73 72 63 2c 20 73 69 |dleSize(|rsrc, si|
|00003000| 7a 65 29 3b 0d 09 09 09 | 54 48 52 4f 57 49 46 4d |ze);....|THROWIFM|
|00003010| 45 4d 45 52 52 4f 52 28 | 29 3b 0d 09 09 09 48 4c |EMERROR(|);....HL|
|00003020| 6f 63 6b 28 72 73 72 63 | 29 3b 0d 09 09 09 54 48 |ock(rsrc|);....TH|
|00003030| 52 4f 57 49 46 4f 53 45 | 52 52 28 41 45 47 65 74 |ROWIFOSE|RR(AEGet|
|00003040| 50 61 72 61 6d 50 74 72 | 28 26 6d 65 73 73 61 67 |ParamPtr|(&messag|
|00003050| 65 2c 20 27 44 41 54 41 | 27 2c 20 27 64 61 74 61 |e, 'DATA|', 'data|
|00003060| 27 2c 20 26 61 63 74 75 | 61 6c 4d 73 67 54 79 70 |', &actu|alMsgTyp|
|00003070| 65 2c 20 2a 72 73 72 63 | 2c 20 73 69 7a 65 2c 20 |e, *rsrc|, size, |
|00003080| 26 73 69 7a 65 29 29 3b | 0d 09 09 09 48 55 6e 6c |&size));|....HUnl|
|00003090| 6f 63 6b 28 72 73 72 63 | 29 3b 0d 09 09 09 43 68 |ock(rsrc|);....Ch|
|000030a0| 61 6e 67 65 64 52 65 73 | 6f 75 72 63 65 28 72 73 |angedRes|ource(rs|
|000030b0| 72 63 29 3b 0d 09 09 09 | 54 48 52 4f 57 49 46 52 |rc);....|THROWIFR|
|000030c0| 45 53 45 52 52 4f 52 28 | 29 3b 0d 23 69 66 20 71 |ESERROR(|);.#if q|
|000030d0| 4d 61 63 41 70 70 56 65 | 72 73 69 6f 6e 20 3c 3d |MacAppVe|rsion <=|
|000030e0| 20 33 33 0d 09 09 09 66 | 69 2e 53 75 63 63 65 73 | 33....f|i.Succes|
|000030f0| 73 28 29 3b 0d 23 65 6e | 64 69 66 0d 09 09 7d 0d |s();.#en|dif...}.|
|00003100| 23 69 66 20 71 4d 61 63 | 41 70 70 56 65 72 73 69 |#if qMac|AppVersi|
|00003110| 6f 6e 20 3c 3d 20 33 33 | 0d 09 09 65 6c 73 65 0d |on <= 33|...else.|
|00003120| 09 09 09 65 72 72 6f 72 | 20 3d 20 66 69 2e 65 72 |...error| = fi.er|
|00003130| 72 6f 72 3b 0d 23 65 6c | 73 65 0d 09 09 63 61 74 |ror;.#el|se...cat|
|00003140| 63 68 20 28 43 45 78 63 | 65 70 74 69 6f 6e 5f 41 |ch (CExc|eption_A|
|00003150| 43 26 20 74 68 65 45 78 | 63 65 70 74 69 6f 6e 29 |C& theEx|ception)|
|00003160| 0d 09 09 7b 0d 09 09 09 | 65 72 72 6f 72 20 3d 20 |...{....|error = |
|00003170| 74 68 65 45 78 63 65 70 | 74 69 6f 6e 2e 47 65 74 |theExcep|tion.Get|
|00003180| 45 72 72 6f 72 28 29 3b | 0d 09 09 7d 0d 23 65 6e |Error();|...}.#en|
|00003190| 64 69 66 0d 09 7d 0d 09 | 54 48 52 4f 57 49 46 4f |dif..}..|THROWIFO|
|000031a0| 53 45 52 52 28 41 45 50 | 75 74 50 61 72 61 6d 50 |SERR(AEP|utParamP|
|000031b0| 74 72 28 26 72 65 70 6c | 79 2c 20 6b 65 79 45 72 |tr(&repl|y, keyEr|
|000031c0| 72 6f 72 4e 75 6d 62 65 | 72 2c 20 74 79 70 65 53 |rorNumbe|r, typeS|
|000031d0| 68 6f 72 74 49 6e 74 65 | 67 65 72 2c 20 26 65 72 |hortInte|ger, &er|
|000031e0| 72 6f 72 2c 20 73 69 7a | 65 6f 66 28 65 72 72 6f |ror, siz|eof(erro|
|000031f0| 72 29 29 29 3b 0d 7d 0d | 0d 0d 2f 2f 09 48 61 6e |r)));.}.|..//.Han|
|00003200| 64 6c 65 20 74 68 65 20 | 72 65 6d 6f 76 65 20 72 |dle the |remove r|
|00003210| 65 73 6f 75 72 63 65 20 | 41 70 70 6c 65 45 76 65 |esource |AppleEve|
|00003220| 6e 74 2e 0d 2f 2f 0d 2f | 2f 09 6d 65 73 73 61 67 |nt..//./|/.messag|
|00003230| 65 3a 09 09 74 68 65 20 | 41 70 70 6c 65 45 76 65 |e:..the |AppleEve|
|00003240| 6e 74 0d 2f 2f 09 72 65 | 70 6c 79 3a 09 09 09 74 |nt.//.re|ply:...t|
|00003250| 68 65 20 72 65 70 6c 79 | 20 41 70 70 6c 65 45 76 |he reply| AppleEv|
|00003260| 65 6e 74 0d 2f 2f 0d 76 | 6f 69 64 20 54 41 64 4c |ent.//.v|oid TAdL|
|00003270| 69 62 4c 69 6e 6b 3a 3a | 52 65 6d 6f 76 65 28 63 |ibLink::|Remove(c|
|00003280| 6f 6e 73 74 20 41 70 70 | 6c 65 45 76 65 6e 74 26 |onst App|leEvent&|
|00003290| 20 6d 65 73 73 61 67 65 | 2c 20 41 70 70 6c 65 45 | message|, AppleE|
|000032a0| 76 65 6e 74 26 20 72 65 | 70 6c 79 29 0d 7b 0d 09 |vent& re|ply).{..|
|000032b0| 73 68 6f 72 74 20 69 64 | 3b 0d 09 52 65 73 54 79 |short id|;..ResTy|
|000032c0| 70 65 20 74 79 70 65 3b | 0d 09 44 65 73 63 54 79 |pe type;|..DescTy|
|000032d0| 70 65 20 61 63 74 75 61 | 6c 4d 73 67 54 79 70 65 |pe actua|lMsgType|
|000032e0| 3b 0d 09 53 69 7a 65 20 | 73 69 7a 65 3b 0d 09 4f |;..Size |size;..O|
|000032f0| 53 45 72 72 20 65 72 72 | 6f 72 3b 0d 0d 09 54 48 |SErr err|or;...TH|
|00003300| 52 4f 57 49 46 4f 53 45 | 52 52 28 41 45 47 65 74 |ROWIFOSE|RR(AEGet|
|00003310| 50 61 72 61 6d 50 74 72 | 28 26 6d 65 73 73 61 67 |ParamPtr|(&messag|
|00003320| 65 2c 20 27 52 54 59 50 | 27 2c 20 27 52 53 52 43 |e, 'RTYP|', 'RSRC|
|00003330| 27 2c 20 26 61 63 74 75 | 61 6c 4d 73 67 54 79 70 |', &actu|alMsgTyp|
|00003340| 65 2c 20 26 74 79 70 65 | 2c 20 73 69 7a 65 6f 66 |e, &type|, sizeof|
|00003350| 28 74 79 70 65 29 2c 20 | 26 73 69 7a 65 29 29 3b |(type), |&size));|
|00003360| 0d 09 54 48 52 4f 57 49 | 46 4f 53 45 52 52 28 41 |..THROWI|FOSERR(A|
|00003370| 45 47 65 74 50 61 72 61 | 6d 50 74 72 28 26 6d 65 |EGetPara|mPtr(&me|
|00003380| 73 73 61 67 65 2c 20 27 | 52 49 44 20 27 2c 20 74 |ssage, '|RID ', t|
|00003390| 79 70 65 53 68 6f 72 74 | 49 6e 74 65 67 65 72 2c |ypeShort|Integer,|
|000033a0| 20 26 61 63 74 75 61 6c | 4d 73 67 54 79 70 65 2c | &actual|MsgType,|
|000033b0| 20 26 69 64 2c 20 73 69 | 7a 65 6f 66 28 69 64 29 | &id, si|zeof(id)|
|000033c0| 2c 20 26 73 69 7a 65 29 | 29 3b 0d 0d 09 73 68 6f |, &size)|);...sho|
|000033d0| 72 74 20 63 75 72 52 73 | 72 63 46 69 6c 65 20 3d |rt curRs|rcFile =|
|000033e0| 20 55 53 45 52 45 53 46 | 49 4c 45 28 67 41 70 70 | USERESF|ILE(gApp|
|000033f0| 6c 69 63 61 74 69 6f 6e | 52 65 66 4e 75 6d 29 3b |lication|RefNum);|
|00003400| 0d 09 42 6f 6f 6c 65 61 | 6e 20 63 75 72 52 65 73 |..Boolea|n curRes|
|00003410| 4c 6f 61 64 20 3d 20 4c | 4d 47 65 74 52 65 73 4c |Load = L|MGetResL|
|00003420| 6f 61 64 28 29 3b 0d 09 | 53 65 74 52 65 73 4c 6f |oad();..|SetResLo|
|00003430| 61 64 28 46 41 4c 53 45 | 29 3b 0d 09 48 61 6e 64 |ad(FALSE|);..Hand|
|00003440| 6c 65 20 72 73 72 63 20 | 3d 20 47 65 74 31 52 65 |le rsrc |= Get1Re|
|00003450| 73 6f 75 72 63 65 28 74 | 79 70 65 2c 20 69 64 29 |source(t|ype, id)|
|00003460| 3b 0d 09 65 72 72 6f 72 | 20 3d 20 52 65 73 45 72 |;..error| = ResEr|
|00003470| 72 6f 72 28 29 3b 0d 09 | 53 65 74 52 65 73 4c 6f |ror();..|SetResLo|
|00003480| 61 64 28 63 75 72 52 65 | 73 4c 6f 61 64 29 3b 0d |ad(curRe|sLoad);.|
|00003490| 09 69 66 20 28 65 72 72 | 6f 72 20 3d 3d 20 6e 6f |.if (err|or == no|
|000034a0| 45 72 72 29 0d 09 7b 0d | 09 09 52 65 6d 6f 76 65 |Err)..{.|..Remove|
|000034b0| 52 65 73 6f 75 72 63 65 | 28 72 73 72 63 29 3b 0d |Resource|(rsrc);.|
|000034c0| 09 09 65 72 72 6f 72 20 | 3d 20 52 65 73 45 72 72 |..error |= ResErr|
|000034d0| 6f 72 28 29 3b 0d 09 7d | 0d 09 55 53 45 52 45 53 |or();..}|..USERES|
|000034e0| 46 49 4c 45 28 63 75 72 | 52 73 72 63 46 69 6c 65 |FILE(cur|RsrcFile|
|000034f0| 29 3b 0d 09 54 48 52 4f | 57 49 46 4f 53 45 52 52 |);..THRO|WIFOSERR|
|00003500| 28 41 45 50 75 74 50 61 | 72 61 6d 50 74 72 28 26 |(AEPutPa|ramPtr(&|
|00003510| 72 65 70 6c 79 2c 20 6b | 65 79 45 72 72 6f 72 4e |reply, k|eyErrorN|
|00003520| 75 6d 62 65 72 2c 20 74 | 79 70 65 53 68 6f 72 74 |umber, t|ypeShort|
|00003530| 49 6e 74 65 67 65 72 2c | 20 28 50 74 72 29 20 26 |Integer,| (Ptr) &|
|00003540| 65 72 72 6f 72 2c 20 73 | 69 7a 65 6f 66 28 65 72 |error, s|izeof(er|
|00003550| 72 6f 72 29 29 29 3b 0d | 7d 0d 0d 0d 2f 2f 09 48 |ror)));.|}...//.H|
|00003560| 61 6e 64 6c 65 20 74 68 | 65 20 73 65 74 20 72 65 |andle th|e set re|
|00003570| 73 6f 75 72 63 65 20 69 | 6e 66 6f 20 41 70 70 6c |source i|nfo Appl|
|00003580| 65 45 76 65 6e 74 2e 0d | 2f 2f 0d 2f 2f 09 6d 65 |eEvent..|//.//.me|
|00003590| 73 73 61 67 65 3a 09 09 | 74 68 65 20 41 70 70 6c |ssage:..|the Appl|
|000035a0| 65 45 76 65 6e 74 0d 2f | 2f 09 72 65 70 6c 79 3a |eEvent./|/.reply:|
|000035b0| 09 09 09 74 68 65 20 72 | 65 70 6c 79 20 41 70 70 |...the r|eply App|
|000035c0| 6c 65 45 76 65 6e 74 0d | 2f 2f 0d 76 6f 69 64 20 |leEvent.|//.void |
|000035d0| 54 41 64 4c 69 62 4c 69 | 6e 6b 3a 3a 53 65 74 28 |TAdLibLi|nk::Set(|
|000035e0| 63 6f 6e 73 74 20 41 70 | 70 6c 65 45 76 65 6e 74 |const Ap|pleEvent|
|000035f0| 26 20 6d 65 73 73 61 67 | 65 2c 20 41 70 70 6c 65 |& messag|e, Apple|
|00003600| 45 76 65 6e 74 26 20 72 | 65 70 6c 79 29 0d 7b 0d |Event& r|eply).{.|
|00003610| 09 73 68 6f 72 74 20 6f | 6c 64 49 44 2c 20 6e 65 |.short o|ldID, ne|
|00003620| 77 49 44 3b 0d 09 52 65 | 73 54 79 70 65 20 74 79 |wID;..Re|sType ty|
|00003630| 70 65 3b 0d 09 43 53 54 | 52 32 35 35 20 6e 61 6d |pe;..CST|R255 nam|
|00003640| 65 3b 0d 09 44 65 73 63 | 54 79 70 65 20 61 63 74 |e;..Desc|Type act|
|00003650| 75 61 6c 4d 73 67 54 79 | 70 65 3b 0d 09 53 69 7a |ualMsgTy|pe;..Siz|
|00003660| 65 20 73 69 7a 65 3b 0d | 09 4f 53 45 72 72 20 65 |e size;.|.OSErr e|
|00003670| 72 72 6f 72 3b 0d 0d 09 | 54 48 52 4f 57 49 46 4f |rror;...|THROWIFO|
|00003680| 53 45 52 52 28 41 45 47 | 65 74 50 61 72 61 6d 50 |SERR(AEG|etParamP|
|00003690| 74 72 28 26 6d 65 73 73 | 61 67 65 2c 20 27 52 54 |tr(&mess|age, 'RT|
|000036a0| 59 50 27 2c 20 27 52 53 | 52 43 27 2c 20 26 61 63 |YP', 'RS|RC', &ac|
|000036b0| 74 75 61 6c 4d 73 67 54 | 79 70 65 2c 20 26 74 79 |tualMsgT|ype, &ty|
|000036c0| 70 65 2c 20 73 69 7a 65 | 6f 66 28 74 79 70 65 29 |pe, size|of(type)|
|000036d0| 2c 20 26 73 69 7a 65 29 | 29 3b 0d 09 54 48 52 4f |, &size)|);..THRO|
|000036e0| 57 49 46 4f 53 45 52 52 | 28 41 45 47 65 74 50 61 |WIFOSERR|(AEGetPa|
|000036f0| 72 61 6d 50 74 72 28 26 | 6d 65 73 73 61 67 65 2c |ramPtr(&|message,|
|00003700| 20 27 52 49 44 20 27 2c | 20 74 79 70 65 53 68 6f | 'RID ',| typeSho|
|00003710| 72 74 49 6e 74 65 67 65 | 72 2c 20 26 61 63 74 75 |rtIntege|r, &actu|
|00003720| 61 6c 4d 73 67 54 79 70 | 65 2c 20 26 6f 6c 64 49 |alMsgTyp|e, &oldI|
|00003730| 44 2c 20 73 69 7a 65 6f | 66 28 6f 6c 64 49 44 29 |D, sizeo|f(oldID)|
|00003740| 2c 20 26 73 69 7a 65 29 | 29 3b 0d 09 54 48 52 4f |, &size)|);..THRO|
|00003750| 57 49 46 4f 53 45 52 52 | 28 41 45 47 65 74 50 61 |WIFOSERR|(AEGetPa|
|00003760| 72 61 6d 50 74 72 28 26 | 6d 65 73 73 61 67 65 2c |ramPtr(&|message,|
|00003770| 20 27 49 44 20 20 27 2c | 20 74 79 70 65 53 68 6f | 'ID ',| typeSho|
|00003780| 72 74 49 6e 74 65 67 65 | 72 2c 20 26 61 63 74 75 |rtIntege|r, &actu|
|00003790| 61 6c 4d 73 67 54 79 70 | 65 2c 20 26 6e 65 77 49 |alMsgTyp|e, &newI|
|000037a0| 44 2c 20 73 69 7a 65 6f | 66 28 6e 65 77 49 44 29 |D, sizeo|f(newID)|
|000037b0| 2c 20 26 73 69 7a 65 29 | 29 3b 0d 09 54 48 52 4f |, &size)|);..THRO|
|000037c0| 57 49 46 4f 53 45 52 52 | 28 41 45 47 65 74 50 61 |WIFOSERR|(AEGetPa|
|000037d0| 72 61 6d 50 74 72 28 26 | 6d 65 73 73 61 67 65 2c |ramPtr(&|message,|
|000037e0| 20 27 4e 41 4d 45 27 2c | 20 74 79 70 65 43 68 61 | 'NAME',| typeCha|
|000037f0| 72 2c 20 26 61 63 74 75 | 61 6c 4d 73 67 54 79 70 |r, &actu|alMsgTyp|
|00003800| 65 2c 20 26 6e 61 6d 65 | 5b 31 5d 2c 20 73 69 7a |e, &name|[1], siz|
|00003810| 65 6f 66 28 6e 61 6d 65 | 29 20 2d 20 31 2c 20 26 |eof(name|) - 1, &|
|00003820| 73 69 7a 65 29 29 3b 0d | 09 6e 61 6d 65 2e 4c 65 |size));.|.name.Le|
|00003830| 6e 67 74 68 28 29 20 3d | 20 28 63 68 61 72 29 20 |ngth() =| (char) |
|00003840| 73 69 7a 65 3b 0d 0d 09 | 73 68 6f 72 74 20 63 75 |size;...|short cu|
|00003850| 72 52 73 72 63 46 69 6c | 65 20 3d 20 55 53 45 52 |rRsrcFil|e = USER|
|00003860| 45 53 46 49 4c 45 28 67 | 41 70 70 6c 69 63 61 74 |ESFILE(g|Applicat|
|00003870| 69 6f 6e 52 65 66 4e 75 | 6d 29 3b 0d 09 42 6f 6f |ionRefNu|m);..Boo|
|00003880| 6c 65 61 6e 20 63 75 72 | 52 65 73 4c 6f 61 64 20 |lean cur|ResLoad |
|00003890| 3d 20 4c 4d 47 65 74 52 | 65 73 4c 6f 61 64 28 29 |= LMGetR|esLoad()|
|000038a0| 3b 0d 09 53 65 74 52 65 | 73 4c 6f 61 64 28 46 41 |;..SetRe|sLoad(FA|
|000038b0| 4c 53 45 29 3b 0d 09 48 | 61 6e 64 6c 65 20 72 73 |LSE);..H|andle rs|
|000038c0| 72 63 20 3d 20 47 65 74 | 31 52 65 73 6f 75 72 63 |rc = Get|1Resourc|
|000038d0| 65 28 74 79 70 65 2c 20 | 6f 6c 64 49 44 29 3b 0d |e(type, |oldID);.|
|000038e0| 09 65 72 72 6f 72 20 3d | 20 52 65 73 45 72 72 6f |.error =| ResErro|
|000038f0| 72 28 29 3b 0d 09 53 65 | 74 52 65 73 4c 6f 61 64 |r();..Se|tResLoad|
|00003900| 28 63 75 72 52 65 73 4c | 6f 61 64 29 3b 0d 09 69 |(curResL|oad);..i|
|00003910| 66 20 28 65 72 72 6f 72 | 20 3d 3d 20 6e 6f 45 72 |f (error| == noEr|
|00003920| 72 29 0d 09 7b 0d 09 09 | 53 65 74 52 65 73 49 6e |r)..{...|SetResIn|
|00003930| 66 6f 28 72 73 72 63 2c | 20 6e 65 77 49 44 2c 20 |fo(rsrc,| newID, |
|00003940| 6e 61 6d 65 29 3b 0d 09 | 09 65 72 72 6f 72 20 3d |name);..|.error =|
|00003950| 20 52 65 73 45 72 72 6f | 72 28 29 3b 0d 09 7d 0d | ResErro|r();..}.|
|00003960| 09 55 53 45 52 45 53 46 | 49 4c 45 28 63 75 72 52 |.USERESF|ILE(curR|
|00003970| 73 72 63 46 69 6c 65 29 | 3b 0d 09 54 48 52 4f 57 |srcFile)|;..THROW|
|00003980| 49 46 4f 53 45 52 52 28 | 41 45 50 75 74 50 61 72 |IFOSERR(|AEPutPar|
|00003990| 61 6d 50 74 72 28 26 72 | 65 70 6c 79 2c 20 6b 65 |amPtr(&r|eply, ke|
|000039a0| 79 45 72 72 6f 72 4e 75 | 6d 62 65 72 2c 20 74 79 |yErrorNu|mber, ty|
|000039b0| 70 65 53 68 6f 72 74 49 | 6e 74 65 67 65 72 2c 20 |peShortI|nteger, |
|000039c0| 26 65 72 72 6f 72 2c 20 | 73 69 7a 65 6f 66 28 65 |&error, |sizeof(e|
|000039d0| 72 72 6f 72 29 29 29 3b | 0d 7d 0d 0d 23 65 6e 64 |rror)));|.}..#end|
|000039e0| 69 66 0d 0d 0d 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |if...///|////////|
|000039f0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00003a00| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00003a10| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00003a20| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00003a30| 2f 2f 2f 0d 0d 23 70 72 | 61 67 6d 61 20 73 65 67 |///..#pr|agma seg|
|00003a40| 6d 65 6e 74 20 41 49 6e | 69 74 0d 0d 76 6f 69 64 |ment AIn|it..void|
|00003a50| 20 52 65 67 69 73 74 65 | 72 54 41 64 4c 69 62 4c | Registe|rTAdLibL|
|00003a60| 69 6e 6b 28 29 3b 09 09 | 2f 2f 20 66 75 6e 63 74 |ink();..|// funct|
|00003a70| 69 6f 6e 20 70 72 6f 74 | 6f 74 79 70 65 0d 0d 76 |ion prot|otype..v|
|00003a80| 6f 69 64 20 52 65 67 69 | 73 74 65 72 54 41 64 4c |oid Regi|sterTAdL|
|00003a90| 69 62 4c 69 6e 6b 28 29 | 0d 7b 0d 23 69 66 20 71 |ibLink()|.{.#if q|
|00003aa0| 4d 61 63 41 70 70 56 65 | 72 73 69 6f 6e 20 3d 3d |MacAppVe|rsion ==|
|00003ab0| 20 33 30 0d 09 6e 65 77 | 20 54 41 64 4c 69 62 4c | 30..new| TAdLibL|
|00003ac0| 69 6e 6b 3b 0d 23 65 6c | 73 65 0d 09 4d 41 5f 52 |ink;.#el|se..MA_R|
|00003ad0| 45 47 49 53 54 45 52 5f | 43 4c 41 53 53 28 54 41 |EGISTER_|CLASS(TA|
|00003ae0| 64 4c 69 62 4c 69 6e 6b | 29 3b 0d 23 65 6e 64 69 |dLibLink|);.#endi|
|00003af0| 66 0d 7d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |f.}.....|........|
|00003b00| 00 00 01 00 00 00 01 7c | 00 00 00 7c 00 00 00 5e |.......||...|...^|
|00003b10| 74 a5 55 7a 5b da 5b 03 | 67 2e 4a 45 67 2a 42 01 |t.Uz[.[.|g.JEg*B.|
|00003b20| f6 2c 20 01 20 18 2e 02 | 48 c5 2f 05 33 4c 01 f3 |., . ...|H./.3L..|
|00003b30| 0e 55 41 64 4c 69 62 4c | 69 6e 6b 2e 63 70 70 72 |.UAdLibL|ink.cppr|
|00003b40| 20 53 70 6f 6f 6c 65 72 | 74 65 62 75 67 29 74 65 | Spooler|tebug)te|
|00003b50| 02 00 54 45 58 54 43 57 | 49 45 01 00 00 00 00 80 |..TEXTCW|IE......|
|00003b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b70| 00 00 a7 72 89 37 00 00 | 3a 73 00 00 01 da 50 01 |...r.7..|:s....P.|
|00003b80| 09 72 57 9f 50 01 24 72 | 57 79 57 9f 50 01 08 92 |.rW.P.$r|WyW.P...|
|00003b90| 9d 68 82 01 66 5c 57 79 | 46 f1 57 9f 46 47 02 bc |.h..f\Wy|F.W.FG..|
|00003ba0| 87 6f 04 b9 bb 61 01 d0 | 6e 9f bc 72 57 79 50 49 |.o...a..|n..rWyPI|
|00003bb0| 47 57 9f 50 49 f1 02 be | 86 6f 04 61 bb b9 02 d0 |GW.PI...|.o.a....|
|00003bc0| 6e ff ea bc b6 01 3d 6e | 9f 79 02 3d 6e ff ea cd |n.....=n|.y.=n...|
|00003bd0| 3a 59 4d b2 79 02 20 d9 | 20 d9 73 02 10 c0 ff dc |:YM.y. .| .s.....|
|00003be0| 20 09 01 ff cc 5c 24 20 | 02 30 92 37 94 7f d7 4d | ....\$ |.0.7...M|
|00003bf0| 5b 86 01 0c 05 59 5b 20 | 06 20 21 47 3c a1 68 4f |[....Y[ |. !G<.hO|
|00003c00| 00 00 00 1e 00 50 00 20 | 02 55 02 28 00 50 00 20 |.....P. |.U.(.P. |
|00003c10| 02 55 02 28 00 00 00 00 | 00 00 00 00 00 00 00 00 |.U.(....|........|
|00003c20| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00003c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c40| 00 00 00 00 00 00 00 00 | 00 02 00 02 00 2c 00 08 |........|.....,..|
|00003c50| 02 40 02 5e 00 2c 00 08 | 02 40 02 5e b3 bf 93 df |.@.^.,..|.@.^....|
|00003c60| 00 00 10 c5 00 00 10 c5 | 00 00 0b bc 01 00 00 00 |........|........|
|00003c70| 00 02 00 00 00 00 00 04 | 00 01 00 01 00 00 01 00 |........|........|
|00003c80| 00 00 01 7c 00 00 00 7c | 00 00 00 5e 08 35 28 c4 |...|...||...^.5(.|
|00003c90| 21 6c 00 00 00 1c 00 5e | 00 01 4d 50 53 52 00 02 |!l.....^|..MPSR..|
|00003ca0| 00 12 4d 57 42 42 00 00 | 00 36 03 f0 ff ff 00 00 |..MWBB..|.6......|
|00003cb0| 00 00 00 00 00 00 03 ed | ff ff 00 00 00 22 00 00 |........|....."..|
|00003cc0| 00 00 03 ef ff ff 00 00 | 00 6e 00 00 00 00 03 f0 |........|.n......|
|00003cd0| ff ff 00 00 00 74 00 00 | 00 00 00 00 00 00 00 00 |.....t..|........|
|00003ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+